Write “WEB PACKAGING” in the field for Packing Note (Field ID: custbody5) If the CUSTOMER SEGMENT = RETAIL BLVD for orders imported into NetSuite from BLVDCA.COM.
solution :
For adding a value to a custom field in the sales order based on the customer segment (a field in Netsuite customer record) and website :
- Update the workflow script PTC-196 WF JJ Set shipping cost methd SO
code snippet:
var retailBLVD = "Retail Blvd"
//WEB PACKAGING section starts
try {
var website = soRecord.getValue({
fieldId: 'website'
});
var customerSeg_wp = false;
segmentObj.forEach(function(segment) {
if (segment.text == retailBLVD)
customerSeg_wp = true;
});
if(customerSeg_wp && (website === 2 || website === "2" ))
{ log.debug('if true')
soRecord.setValue({
fieldId: 'custbody5',
value: "WEB PACKAGING"
});
}
}
catch (err) {
log.debug('website', err)
log.debug('WEB PACKAGING', err)
}
//WEB PACKAGING section ends
Important Note: Note that if there were any other separate workflow script already written for Guest Customers Sales Orders then we have to update on that script also for applying the changes to guest customer roles. Then only it will work both in the case of guest customers and registered customers.