I’m setting a custom `rate` value using `tx.setSub...
# suitescript
j
I’m setting a custom
rate
value using
tx.setSublistValue({sublistId: 'item', fieldId: 'custcol_rate', line: i, value: 0, ignoreFieldChange: false});
in a BeforeRecordLoad UserEvent. The value isn’t coming out as a percentage in the UI though. Anyone know how to make it show as a percent, same as it would if you changed it in client script? I want it to look like the top one, not the bottom.
z
rate in percent?!? What I've missed?
j
oh god sorry this is actually a custom column
let me edit my above
👍 1
z
and type. of custcol_rate is percentage... sorry if I ask newbie questions
j
yes
c
You can use N/format and format the value as a percent.
Copy code
format.format({value: 0, type: format.Type.PERCENT});