Hi All, While importing subscriptions by SuiteScri...
# suitescript
m
Hi All, While importing subscriptions by SuiteScript i am tring to set the discount of some lines to '100%' this is possible in the UI and is stored as such: but when importing using suitescript i get the following error: "U hebt een ongeldige veldwaarde 100.00% voor het volgende veld ingevoerd: discount" which translates to "you entered a invalid value '100.00%' for the field 'discount'"
Als with "100%" it is not working btw
d
Try to put number 1.0 into that field
m
Well the script continues but the discount is imported as 1.00
so 1 dollar instead of 100% 😉
d
You sure that the field type is percent?
If it is just number, then put 100
m
wel de discount field in the UI accepts numbers
which will be translated into net discount
but it also accepts a number suffixed by '%' which makes it a calculated discount on the sum of the item
i'm not sure if i need to do something in suitescript to have netsuite interperet it as a percentage
d
Did you try setText?
Copy code
discountItem.setText({fieldId:'rate',text:'8.5%'});
m
i will try
@Dmitry Masanov lifesaver! 😅
set text works and it stores the value as a percentage
👍 2