ANS-0687 · SUITESCRIPT DEVELOPMENT
How to Script Purchase Order and Request Approval in NetSuite Employee Center
To script Purchase Order and Purchase Request approvals in NetSuite's Employee Center, modify the supervisor approval field within an afterSubmit event.
Short answer
When attempting to script the approval of Purchase Orders or Purchase Requests in NetSuite's Employee Center, direct modification of the "supervisorapproval" field within a beforeSubmit event is ineffective. The correct approach is to load the record and perform the necessary updates to the "supervisorapproval" field during an afterSubmit event.
Scenario
Users attempting to automate the approval process for Purchase Orders (PO) or Purchase Requests (PR) within the NetSuite Employee Center via scripting may encounter issues. Specifically, attempts to modify the "supervisorapproval" field using a beforeSubmit event prove unsuccessful, as the field appears uneditable at that stage.
Solution
To successfully control the approval of a Purchase Order or Purchase Request via script in the NetSuite Employee Center, the modification of the "supervisorapproval" field must be performed within an afterSubmit event. This workaround addresses the limitation where the "supervisorapproval" field cannot be directly edited during a beforeSubmit event. The recommended approach is to perform the modification by loading the record in an afterSubmit event.
Expert NetSuite Support
Need help with this NetSuite issue?
SuiteScript Development consulting and configuration support
