Hi,
I am using the Assembly Items, Advanced Bill of Material and Work Order features on my NS account, and I am having an issue on saving Work Order record.
Netsuite native behavior for assembly items marked as “special work order item”-is that when this item is selected on a sales order, the box in the ‘Create WO’ column is checked by default, and when saving the sales order, the box is saved with the work order number transaction ID instead.
On my account there is a SuitScript our developer wrote that edit and save the Work Order (created by native NS flow) and update/upsert some fields with records that the developer created-
1. Select the Bill of Materials the developer created
2. Select the Bill of Materials Revision the developer created
3. Check WIP checkbox
4. Select the Manufacturing Routing the developer created.
The flow and the SuitScript works perfect when the assembly item on the work order does not have component of assembly type.
But, when the assembly item on the work order does have component of assembly type that marked as “special work order item”, NS open another Work order (as needed, created from the Work order of the original assembly) for the component assembly item, and then I get the below error message on the SuitScript-
{"type":"error.SuiteScriptError","name":"THE_LINE_CANNOT_BE_DELETED_BECAUSE_IT_HAS_A_SPECIAL_ORDER_ASSOCIATED_WITH_IT","message":"The line cannot be deleted because it has a special order associated with it. First, delete the special order and retry.","id":"","stack":["Error\n at RecordInvoker.save (suitescript/resources/javascript/record/serverRecordService.js:371:13)\n at NetSuiteObject.thenableFunction() (suitescript/resources/javascript/record/proxy.js:115:24)\n at /SuiteScripts/SOUserEventHandler.js:97:28\n at Array.forEach (native)\n at handleWorkOrderAlignment (/SuiteScripts/SOUserEventHandler.js:89:28)\n at Object.afterSubmit (/SuiteScripts/SOUserEventHandler.js:147:17)"],"cause":{"type":"internal error","code":"THE_LINE_CANNOT_BE_DELETED_BECAUSE_IT_HAS_A_SPECIAL_ORDER_ASSOCIATED_WITH_IT","details":"The line cannot be deleted because it has a special order associated with it. First, delete the special order and retry.","userEvent":null,"stackTrace":["Error\n at RecordInvoker.save (suitescript/resources/javascript/record/serverRecordService.js:371:13)\n at NetSuiteObject.thenableFunction() (suitescript/resources/javascript/record/proxy.js:115:24)\n at /SuiteScripts/SOUserEventHandler.js:97:28\n at Array.forEach (native)\n at handleWorkOrderAlignment (/SuiteScripts/SOUserEventHandler.js:89:28)\n at Object.afterSubmit (/SuiteScripts/SOUserEventHandler.js:147:17)"],"notifyOff":false},"notifyOff":false,"userFacing":true}
I assume the error occur because another Work Order being created for the assembly component, since on a more basic flow (where there is no assembly component on the original assembly) the script and the native NS flow works OK.
Are you familiar with this error and know how to solve it so the script will work as well in this case?
Thanks in advance,