Does anyone know if it is possible to get the valu...
# suitescript
g
Does anyone know if it is possible to get the value of the shipping address and billing address fields in a User Event Script? I added this line in the script:
Copy code
log.debug("beforeSubmit", "billzip: "  + record.getValue({ fieldId: "billzip"}));
But the log shows undefined: billzip: undefined I tried to get the value in the console using the nlapiGetFieldValue sentence and I was able to get it:
s
I just use NFT and it looks something like this to get the billing address zip code:
Copy code
rec.billingaddress.zip
e
I believe you need to load the Billing Address subrecord first. Like so;
Copy code
const billingSubrecord = record.getSubrecord('billingaddress')
const billZip = billingSubrecord.getValue('zip');
👍 1
g
Thank you @ericbirdsall it works 🥳