How does MSR work in SuiteScript?
When working with MSR-enabled transactions in SuiteScript, developers should be aware of the following:
? In SuiteScript, at the time of creating a sales order, you cannot override the default shipping rate that has been set for an item. SuiteScript developers should be aware of this when creating user event and scheduled scripts.
? There is no SuiteScript equivalent of the Calculate Shipping button that appears on the Shipping tab. In SuiteScript, shipping calculations are handled by the NetSuite backend when the transaction is submitted.
? The nlapiTransformRecord(…) API includes an optional shipgroup setting.
For example:
var itemFulfillment = nlapiTransformRecord('salesorder', id, 'itemfulfillment', { ' shipgroup ' : 50 });
var fulfillmentId = nlapiSubmitRecord(itemFulfillment, true);
When working with MSR-enabled transactions, you must specify a value for shipgroup during your transforms.
If you do not specify a value, the value 1 (for the first shipping group) is defaulted. This means that only the items belonging to the first shipping group will be fulfilled when the sales order is transformed.
? In both the UI and in SuiteScript, if you make any update to any item on MSR-enabled transactions, this action may result in changes to the shipping cost. Every time an item is updated and the record is submitted, NetSuite re-calculates the shipping rate. NetSuite calculates all orders based on “real-time” shipping rates.
? In both the UI and in SuiteScript, the only transformation workflow that is impacted by MSR is the sales order to fulfillment workflow. Invoicing and other transaction workflows are not impacted.
? After MSR is enabled, and the Enable Item Line Shipping box is checked, the Sales Order displays a shipaddress, shipcarrier, and shipmethod field for each item line.
? Selecting an item line sends a system request that reloads the available Carrier (shipcarrier) and Ship Via (shipmethod) lists. Reloading these fields prompts post-sourcing to trigger twice.