Discussions
Narrative Insights is Temporarily Unavailable due to an Infrastructure Issue. Learn how This Impacts Your Account and What to Expect While the Feature is Disabled.
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({