Tuesday, May 21, 2019

UserEvent Script AfterSubmit Event - Get the Correct Sales Order Status After Clicking Approve

After approving the Sales Order, the AfterSubmit event will trigger and the Sales Order status should be in Pending Fulfillment.

Using the API nlapiGetFieldText('orderstatus') does not pull the correct status of the Sales Order once it has been approved. It still shows the status as Pending Approval. It will only display the status as Pending Fulfillment once the Sales Order has been edited/saved. Using nlapiGetFieldText('status') also does not work.

In order to display the correct status of the Sales Order after it has been approved, use this script instead in the AfterSubmit event:


*Note: This will only get the status after approving the Sales Order. Once the Sales Order is fulfilled/billed, since this is done on the item fulfillment record/cash sale record, it will not get the status until the Sales Order itself is edited/saved.

No comments:

Post a Comment