Discussions
Read on for the latest updates including:
• Agenda Builder launch
• SuiteWorld On Air registration
• New NetSuite Prompt Studio Contest
• And more!
Check out this thread to learn more!
How to fix my Script that updates Customer Addresses?
Hi,
I am trying to update the Address field using suitescript. Below is my aftersubmit script. It is not saving the addressee field. There are no errorrs. Can you please help?
var rec = record.load({
type: record.Type.CUSTOMER,
id: custRec.id,
isDynamic: true
});
var count = rec.getLineCount({
sublistId:'addressbook'});
log.debug('count',count);
for(var i=0;i<=count;i++)
{
var subrec2 = rec.getCurrentSublistSubrecord({
sublistId: 'addressbook',
fieldId: 'addressbookaddress' ,
line: i
});
var cust_addressee= subrec2.getValue({
fieldId: 'addressee'
})
var intIDAddress= subrec2.getValue({
fieldId: 'internalid'
})
log.debug('intIDAddress',subrec2.id);
/* var defaultShipping= subrec2.getValue({
fieldId: 'defaultshipping'
})
log.debug('defaultShipping',defaultShipping); */
subrec2.setValue({