Workflow Action Script to Close Transaction
Closed - This job posting has been filled.
I am looking for a custom workflow action that will close a transaction. This will be triggered by a workflow and saved search. I do not know how to write script, the workflow is created but does not have the ability to actually close a pending sales order. I submitted a case to Netsuite Support and this is the response that I received..
I investigated on your concern and found out that you would not be able to close the Sales Order via Workflow as to close the order one of the two things need to be done :
- You can either do it by choosing the button : Close Order on the order
- You can select "Closed" transaction column field on present on each item and once all the items are closed the order status will reflect "Closed"
Both of the above options are not accessible via Workflow.
What you can have is a Workflow action script that would run on each of the saved search records and close it accordingly.
In the script you would need to first :
- GetRecordID > Load Sales Order > Access the Item Sublist > Close Items one after the other
The transaction column field that you need to close has the id "isclosed".
Please refer to article Sublist api (setLineItemValue, CommitLineItem), Record api( getRecordID, SubmitRecord), also pleas refer to Suite Script Records Browser > Sales Order > item Sublist to get list of all standard internal id's that you would require. Below are the Suite Answers article id :
- 10282, 10511, 10278.
Hope this helps. Please let me know if you have further concerns.