Hi any help here... I have created a field changed...
# suitescript
m
Hi any help here... I have created a field changed function in client script. And I was trying to set shipping cost. Shipping cost is calculated based on the shipping method field. I.e. If shipping method is A then set cost to $X else it should calculate dynamically by Netsuite ... But it is not calculating and going into infinite loop.
b
Share the code
m
message has been deleted
s
off topic, but notepad++!, ah the golden years early 2000's
when you set the value include the parameter that tells it not to fire events
I can't remember for sure but it might be a boolean third argument to nlapiSetFieldValue()
b
probably would have been easier to copy and paste the code here
but remove lines 7 through 9, it does not help to set the ship method to the same value
m
But how it calculates the selected shipping method cost
@stalbert those arguments didn't workout
b
if your shipping method is setup to get realtime rates, netsuite will calculate the shipping cost
there should be a calculate shipping cost link on sales order summary and a shipping calculator button on the shipping subtab
netsuite wont let you save the sales order without clicking that link
m
Is there a way to trigger calculate shipping cost after setting the method?
b
not via suitescript, you can do a virtual click via javascript
m
This is actually for website
b
if you mean sitebuilder's scriptable cart, you might want to try #C29HR0BFG