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 does afterSubmit works?
I created a script that must be executed then the Item Fulfillment form is Submitted (Save)
In the Custom Code of the form I selected the script and in the Save Record Function I typed afterSubmit
In my script the afterSubmit function looks like this:
function afterSubmit(type) {
var rshipID = nlapiGetFieldValue('shipmethod');
var sonum = nlapiGetFieldValue('createdfrom');
if (rshipID == 12600) {
rship = 'WILSON TRUCKING (540) 949-3200 (www.wilsontrucking.com)';
}
if (rshipID == 12601) {
rship = 'R+L CARRIERS (800) 543-5589 (www.rlcarriers.com)';
}
var record = nlapiLoadRecord('salesorder', sonum); // load the sales order
record.setFieldValue('custbodyrealshipvia', rship); // set the field display value for Location to East Coast