Customer wants to update some fields after the Sal...
# suitescript
n
Customer wants to update some fields after the Sales Order Shipping Address has been updated or changed. My code snipped returns the previous shipstate but not the newly selected shipstate. How do I get the currently selected shipstate?
var currentRecordObj = context.currentRecord;
var fieldName = context.fieldId;
// Check if the field changed is either 'entity' or 'shipaddresslist'
if (fieldName === 'entity' || fieldName === 'shipaddresslist') {
// Get the value of the 'entity' or 'shipaddresslist' field
var fieldValue = currentRecordObj.getValue({
fieldId: 'shipstate'
});
log.debug('fieldValue : '+fieldValue);
b
n
thanks