Discussions
Join us for complimentary one-day events around the world and step into a future fueled by AI and limitless potential. Explore new breakthroughs, sharpen your skills, and connect with experts who are shaping what’s next. Experience bold keynotes, interactive learning, and connections that span the global NetSuite community. Discover what's next at SuiteConnect Tour 2026.
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.