Hi, I have a user event in the aftersubmit of a cu...
# suitescript
j
Hi, I have a user event in the aftersubmit of a customer where I get the addresses of the customer var customerRecord = nlapiLoadRecord('customer', customerId); var addresslist = customerRecord.addressbook; for(i=0;i<addresslist.length;i++){ data['address_id'] = addresslist[i].id; } When I run the UE it gives me the address id but if it's run trough a scheduled script it don't give me the id field, does anyone knows why? Thanks
s
because I believe that
id
field is undocumented so you probably shouldn't rely on it ever.
as a matter of fact, you're not using supported NS apis at all there - the addresslist isn't an array either, unless you're using NFT
nor is
addressbook
a property on the customer record unless you're using NFT or bypassing the API. So any of that code could break at any moment and you should not be surprised.