Currently, I am faced with the task of generating drop ship purchase orders against existing sales orders in NetSuite that already have one or more drop ship POs associated with them. While typically this can be easily accomplished through the user interface by clicking the "Drop Ship" link on an item line, I am attempting to automate this process using SuiteScript. I believed I had successfully tackled this challenge in the past, but as time has passed, my memory of the specific files I previously worked on has faded.
Unfortunately, the system does not allow me to revert the sales order to a "Pending Approval" status, which would enable me to manipulate statuses in order to trigger the creation of new POs. Despite my efforts, including the following code snippets:
soRecord.setCurrentLineItemValue("item", "createpo", "DropShip");
soRecord.setCurrentLineItemValue("item", "povendor", vendorId);
No action is taken beyond adding the new item lines to the sales order. Additionally, my attempt to link a PO with the appropriate vendor to the item line on the sales order using the code below also proved unsuccessful:
soRecord.setCurrentLineItemValue("item", "createdpo", poId);
I am left wondering if there is something crucial that I am overlooking or if my efforts have been fruitless from the start. Any guidance on this matter would be greatly appreciated.