GM. We are attempting to create a script that aut...
# suitescript
s
GM. We are attempting to create a script that automatically routes sales order line items either to an internal warehouse or a Dropship PO Vendor. A consultant is telling us that it is possible to do that during the sales order creation but that a script cannot change a line item to a DSPO after the order is saved. That it can be done manually but not via script. Does anyone know if that is accurate or has a work-around to take an existing sales order line item and mark it as a dropship po after order creation? Thanks
a
It is possible. It is not a documented process, but it is possible. You can create a custom button in your Sales Order to create a Drop-Ship or Special Order. The line items do not even need to be flagged as drop-ship items or special order items at the item level.
s
thanks but we are writing a script that may be around for a long time and a critical part of our process. We do not really want to use an undocumented process in case it gets blocked down the road.
a
It should not get blocked down because you will be using the same process NetSuite uses when you click the Create Special Order or Create Drop Ship Item at the line level.
s
But that is interactive in the UI. This script is not going to be in the UI but running separately. It is being designed to automatically allocate line items to different DSPO vendors. It would need to access the order and assign the vendor and have it create the PO
a
On paper, adhering to what is documented sounds very noble, future-proof, and bullet-proof, but the reality is that you are going to face problems where you either bend the business process or bend the system, more often than not you will find out that the businesses do not bend their processes that easy and that the benefits of bending the system outweigh those of adhering to what is documented only,
💯 1
b
creating the drop ship purchase order in the ui is implemented as a link that allows you to manually set up the purchase order
the matching action in suitescript is record.create using the same default values used in the query parameters of the link
💯 1
if for some reason you must use the automatic process, then you can edit the sales order to be pending approval again, and then make the changes on the line of the sales order to make it a drop ship, and then reapprove the sales order
which will trigger the automatic drop ship again