When doing setValue() on a percentage field, is it...
# general
c
When doing setValue() on a percentage field, is it possible to force NS to display the % sign?
c
I just tested this with a percentage field and the % is being added. Are you sure this is a percentage field and not a text field?
c
It's percentage
Copy code
record.setCurrentSublistValue({
    sublistId: SUBLIST_ID,
    fieldId: GROSS_PROFIT_MARGIN,
    value: percentage,
    ignoreFieldChange: true
});
The value is 50. I would expect 50% in the field.
When I save the record it adds the %
But before save, it's just the value without %. The users can't get over it.....
c
Still seems to be working for me. Can you just do:
Copy code
record.setCurrentSublistValue({
    sublistId: SUBLIST_ID,
    fieldId: (String(GROSS_PROFIT_MARGIN) + '%'),
    value: percentage,
    ignoreFieldChange: true
});
a
The percent field is a number in reality with formatting for the UI, any percent field you read with getValue will return a number, no including the %, it simply how NetSuite handles percentage fields.