Discussions
Read on for the latest updates including:
• Agenda Builder launch
• SuiteWorld On Air registration
• New NetSuite Prompt Studio Contest
• And more!
Check out this thread to learn more!
Trigger Script when Approving an Order (Pending Approval -> Pending Fulfillment)
Hoping that someone can help me out here with something that may be very simple. Basically I'm looking to populate a field on a Sales Order when the "Approve" button is clicked. The field will populate with today's date, so that I can search when the order was last approved. In the scenario below, the current status is Pending Approval (SalesOrd:A)
Trigger: Status=Pending Approval -> Pending Fulfillment
var today = new Date();
nlapiSetFieldValue('custbody_last_approval_date',today)
Save record
I would imagine this would have to be a User Event script, since some of these triggers may come from the "Approve Orders" screen, while others come from the "Approve" button within the sales order. I would also think that this would have to be a "Before Submit" function. I just have no idea where to place any of this code and how to look specifically for the trigger stated above.