Discussions
Join the NetSuite community to innovate, connect, and discover what’s next.
SuiteWorld brings thousands of innovators, builders, and leaders together to learn, connect, and shape what’s next. This October, explore how to build a stronger foundation for growth through inspiring keynotes, major product reveals, hands-on sessions, and unforgettable moments—all in one place for our biggest event of the year. Register now
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({