unction clientRecalcrate(type){ if (type === 'ite...
# suitescript
j
unction clientRecalcrate(type){ if (type === 'item') { var vatInc = nlapiGetCurrentLineItemValue('item', 'custcol_abj_vat_inclusive_rate'); var Tax = nlapiGetCurrentLineItemValue('item', 'taxrate1'); var ExVat = 1+(Tax/100); var newItemRate = vatInc / ExVat; nlapiSetCurrentLineItemValue('item', 'rate', newItemRate); } return true; } I am gettingĀ this error --------------> Invalid number or percentage var ExVat = 1+(Tax/100); - this is the issue, i added parseFloat but also not working
b
smaller pieces
start with (Tax/100)
j
yes, got it... parseFloat before (tax)/100
thanks!
b
although i think that is safe. you may want to place a warning for the next person who converts it to suitescript 2
percentages act differently between ss2 and ss1
j
ok noted. thank you!