Set Expected Shipment Date and Promised Receipt Date in the Sales order and SPS button action.

Create a script for updating the expected shipment date and promised receipt date in the sales order. Also sending multiple API requests with SPS button action script.

  1. To create a script for updating the expected shipment date and promised receipt date in the sales order.
  2. To automate the “Auto-Pack Shipment” and “Create ASN” button action using the script.
  3. Automate the Create PO ack functionality using saved search results.

Our Solution

Set expected shipment date and promised receipt date

  1. We have already created a scheduled script for Auto purchase order creation from sales orders.
  2. The script only considers the sales orders with the “create auto PO” checkbox is true.
  3. When we are processing these sales orders for creating purchase orders, we will set the expected shipment date and promised receipt date field value for each line item in the sales order. The value will be set for all items in the sales order.
  4. Also, the same value will be forwarded to the purchase order.
  5. The expected shipment date will be 30 days from the current date.
  6. The promised receipt date will be 90 days from the current date.

Automate the Auto-Pack Shipment and Create ASN button action

  1. We will fetch the item fulfillment from the saved search (search id: 14221) using a scheduled script.
  2. We will set up script available without login for auto-pack shipment and Create an ASN script.
  3. After making the script it is available without login. We will send an API request to script an external URL.
  4. These are the script deployment used for Auto-pack shipment and Create ASN functionality.
  5. Auto-pack shipment (script id : customscript_sps_autopack_sl,  deployment id : customdeploy_sps_autopack_sl) 
  6. Create ASN functionality (script id : customscript_sps_sl_svc_create_asn, deployment id : customdeploy_sps_sl_svc_create_asn)
  7. Fetch item fulfill internalId from saved search and first send Get API call to “Auto-pack shipment” suitelet.
  8. The first API call is successful and the carton added count is greater than 0 then we will send the 2nd API call to the “Create  ASN” external suitelet page.
  9. Both API include the parameters named “param1” with value item fulfillment id.
  10. If any error occurs the API call. We sent the email to “rohit@balajiwireless.com”.
  11. Once the item fulfillment is processed using our schedule script we will flag this IF record in Netsuite. The script will not consider the item fulfillment in the next execution.
  12. The script will work one time for one item fulfillment record.

Automate Create PO Ack 

  1. Load saved search from NetSuite saved (search id: 14222)
  2. Using a scheduled script we will process each sales order record.
  3. For processing sales orders we will edit the script, which will created for creating PO ack then set the script deployment as available without login (script id: customscript_sps_sl_create_poack, deployment id: customdeploy_sps_sl_create_poack)
  4. Using the external suitelet URL of this script we will send a Get API request with param1 parameter and parameter value is sales order id.
  5. If the response get error we will send the email to ‘rohit@balajiwireless.com’
  6. The script will work one time for one sales order record.

Assumption

  1. We will not consider any saved search for this scripting purpose.
  2. The date set update only works when the sales orders which are “create auto PO” checkbox is checked.
  3. We will not be responsible for the internal issue while updating the SPS bundle script to available. Also, there will be a chance to uncheck the availability without a checkbox when updating the SPS communication bundle.
  4. Could you please add an internal id column in both searches in the result section?

Leave a comment

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