Automating Special Order Purchase Order Creation

NetSuite allows for the creation of purchase orders based on a sales order using SuiteScript. Special Order purchase orders, which are typically used for drop-ship transactions, can be automatically generated by leveraging SuiteScript’s record.create function. Below is an example script that demonstrates the process.

var po_params = {

  ‘recordmode’: ‘dynamic’,

  ‘soid’: salesOrderIdICPO, // Sales order ID from which PO is being created

  ‘poentity’: poVendorICPO, // Vendor ID for the PO

  ‘specord’: true, // Indicates a special order

  ‘custid’: custIdICPO, // Customer ID

  ‘nexus’: nexus, // Nexus or tax details for the transaction

  ‘entity’: poVendorICPO, // Vendor for the PO

  ‘customform’: 189 // Custom form ID for the purchase order

};

// Create a Purchase Order

var po = record.create({

  type: record.Type.PURCHASE_ORDER,

  isDynamic: true,

  defaultValues: po_params

});

Breakdown of Key Parameters:

  1. recordmode: Set to 'dynamic' to use the dynamic record mode, which allows for easier manipulation of the record.
  2. soid: The ID of the sales order from which the purchase order is derived.
  3. poentity: The vendor entity associated with the purchase order.
  4. specord: A custom boolean field to denote that the PO is for a special order (e.g., drop-ship).
  5. custid: The customer ID for whom the purchase order is created.
  6. nexus: The nexus (tax jurisdiction) for the transaction, if applicable.
  7. entity: The vendor entity (same as poentity).
  8. customform: Specifies the custom form used to create the purchase order.

Leave a comment

Your email address will not be published. Required fields are marked *