Proposal summary
This proposal describes the New CA Warehouse default Script for Sale Orders for Canada subsidiary in Netsuite.
Requirement
Automate warehouse(location field) in sales order using a script based on which state the delivery address/customer is from.
For Canada, it would be as follows:
Delta Warehouse:
Customers from:
- British Columbia
- Yukon
- Northwest Territories
- Nunavut
- Alberta
- Saskatchewan
- Manitoba
Toronto Warehouse:
Customers from:
- Ontario
- Quebec
- New Brunswick
- Nova Scotia
- Prince Edward Island
- New Foundland and Labrador
Our Solution
The solution can be achieved by deploying a new script to the sales order that will automatically set warehouse(fieldid: location) in sales order for OX Tools CA and Orvato Healthcare CA when the user enters a customer in the customer field based on the state of the customer’s shipping address. Also, the script will set the warehouse in the field change of the customer field.
If the user changes the shipping address in the sales order(custom address), then the script will check the state in the shipping address and set the warehouse(fieldid: location) accordingly.
Another server-side script will set the value in the location field in the sales order based on the state in the shipping address on save of the Sales Order.
Risk
- The client side script will work only for the sales orders which are created through UI.
- If the user manually changes the warehouse/location in the sales order, the changed value will not be set in the sales order. The script on save of the SO will overwrite the warehouse based on the state of the customer’s shipping address.
We will add the mapping of the warehouse and state it in the script. So we will have to revise the script if this State-location mapping change in future