ANS-0844 · SUITESCRIPT DEVELOPMENT
How to Programmatically Create a Drop Ship Purchase Order in NetSuite
This guide details the essential parameters for programmatically creating a drop ship purchase order in NetSuite, linking it to a sales order.
Short answer
To programmatically create a drop ship purchase order in NetSuite, use SuiteScript functions with specific parameters like `soid` (Sales Order ID), `dropship` (set to 'T'), `custid` (Customer ID), `entity` (Vendor ID), and `poentity` (Item's Preferred Vendor ID). This process automatically carries over drop ship items.
Scenario
A NetSuite user needs to create a drop ship purchase order programmatically. The challenge involves identifying the correct SuiteScript functions and parameters to ensure the purchase order is properly linked to a source sales order and includes the relevant drop ship items and vendor information.
Solution
To create a drop ship purchase order programmatically, the following SuiteScript 1.0 functions and parameters can be utilized. Note that SuiteScript 1.0 functions like nlapiCreateRecord and nlapiSubmitRecord are considered legacy; NetSuite's current best practice is SuiteScript 2.x, which uses a different modular syntax for record creation and submission.
javascript
po_42 nlapiCreateRecord('purchaseorder',{soid: '2455',shipgroup: '1',
dropship: 'T', custid: '54', entity: '17', poentity: '17'})
nlapiSubmitRecord(po_42);Key parameters for creating the drop ship purchase order include:
soid: The internal ID of the source Sales Order for which the Drop Ship Purchase Order is being created.shipgroup: Controls which shipping address from the customer record is used. This parameter appears to refer to the Nth Ship To Address in the list dropdown. If omitted, no Ship To Address is selected on the Purchase Order. If a custom address is entered on the Sales Order, settingshipgroupto '1' uses the custom address. A direct method for selecting the first Ship To address in the dropdown is not consistently observed.dropship: Indicates that this Purchase Order is a drop ship order. This parameter should be set to 'T'.custid: The internal ID of the customer for whom the drop ship is being performed.entity: The internal ID of the vendor for the Purchase Order.poentity: The internal ID of the item's preferred vendor record.
Drop ship items are automatically carried over into the Purchase Order transaction, even if they do not have the same preferred vendor behavior. The poentity parameter value may influence which items are carried over, though consistent behavior can vary, especially in OneWorld environments.
Expert NetSuite Support
Need help with this NetSuite issue?
SuiteScript Development consulting and configuration support
