Discussions
Narrative Insights is Temporarily Unavailable due to an Infrastructure Issue. Learn how This Impacts Your Account and What to Expect While the Feature is Disabled.
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.