According to Suite Answer Id: 12660, we set the default shipping rate for our in house trucking to Flat Rate =0. This was done several years ago.
Sales will manually calculate the charge and enter it into the shippingcost field on an estimate or salesorder. Up until 6/13/2019 when an estimate or salesorder was edited (item removed, a subtotal recalculation occurred, etc.) and the corresponding SuiteScript triggered, the shipping cost was never affected. Now whenever an edit occurs the shipping cost changes back to the flat rate of Zero.
I found Answer ID 12034 that describes this as a default behavior. I can fix most of the code using NS's suggestion of saving the shipping cost after the loadRecord and resetting the field value just before the submitRecord.
Unfortunately, the shipping cost also gets reset to the Zero flat rate when an item is deleted from the item tab.
My questions :
- How do I catch the recalculation when a line item is deleted?
- Has anyone else experienced this issue since 6/13/19?
- Did NetSuite recently "fix" the behavior described in Answer ID 12034, as we have been on the platform for seven years and have never experienced this prior to 6/13/19.
After further research, I found that saving the shippingcost in the Field changed function and setting the field value again works.
remember to set the parameter to false so as not to create an infinite loop.
nlapiSetFieldValue('shippingcost',orgshippingcost,false);
I also found the need to do the same coding in ALL scripts and functions that change qty or total of the salesorder.
https://netsuite.custhelp.com/app/answers/detail/a_id/34424/kw/34424
An efix was released on June 13th that apparently "fixed" the default behavior of shippingcost.
L.Walsh
Message was edited by: Lewalsh11741
Message was edited by: Lewalsh11741