```var rate_entered = nlapiGetCurrentLineItemValue...
# suitescript
c
Copy code
var rate_entered = nlapiGetCurrentLineItemValue('item', 'rate');

    if (rate_entered.indexOf('%') > -1)
I'm seeing this SS1 code in one NetSuite instance which suggests a % can be entered into the rate line field. I am testing this in the UI and I can see that the if statement evals to true when I enter -50% in the rate field. I wrote the below code in another NetSuite environment
Copy code
const rateEntered = record.getCurrentSublistValue({
    sublistId: SUBLIST_ID,
    fieldId: RATE_FIELD
});

if (rateEntered && String(rateEntered).includes('%')) {
The SS2.1 if statement always evals to false when I enter -50% in the rate field. I have checked the first rate field and it is NOT a custom field. It looks like NS is removing the % before the data is passed to the SS2.1 script; is this somehow working differently in SS1?
I just tested with a very simple SS1 and SS2.1 script. The value in the SS1 script is passed from NS as a STRING. The value in SS2.1 is passed from NS as a NUMBER.
b
behavior of fields that are a string and a number changed between suitescript 1 and 2
in suitescript 2, you would use getCurrentSublistText for the percentage as a string
getCurrentSublistValue for the percentage as a decimal number
c
getCurrentSublistText Had assumed this would have the same behaviour (stripping out the %) but haven't tested yet. Thanks for the pointer, I'll test that today.