We are updating the shipmethod on a sales order be...
# suitescript
d
We are updating the shipmethod on a sales order beforeSubmit but for some reason it is not saving the new shipping cost. For example, if we have a shipmethod of standard at $10 but determine beforeSubmit that an item needs "truck", we then set shipmethod to truck without adjusting any other values. After the record is saved, it still shows $10 in shipping cost but it should be higher because of the truck shipping method. Is it not possible to change the shipmethod and force sourcing beforesubmit?
e
@Dan P From what I understand in order to source the shipping cost once updated the shipmethod you should do this in a afterSubmit Event, loading the record as Dynamic = true, that flag helps you to source any depending field from other, in a beforeSubmit event the record is not dynamic
d
@eminero Thank you. I shall give the afterSubmit a try
e
Go ahead!
d
@eminero No gravy today, I guess. Shipping cost stays the same no matter the ship method I set on a dynamic record load afterSubmit. Kind of makes no sense.. Hm.
e
Hmm that's weird, I would check changing the ship method on the UI for testing and see if the cost indeed change with the same values that I am trying in the script @Dan P. If not, maybe it depends on other value as well
b
check the value of the
shippingcostoverridden
field