I don't know how I've avoided running into headache in the 5-6 years I've been customizing NetSuite, maybe it's the result of a recent version upgrade.
So here's the deal: I have a sublist with a couple INTEGER columns and I'm defaulting them to 0. Here's some code!
items.setLineItemValue( SORASST_FLD.COL_REMAININGRELEASEQTY, lineIndex, 0);
Don't worry yourself about those strange variable names, they are just constants for the identifiers. DO worry yourself about that 0 I'm setting the value to; not 0.0, not '0' or '0.0' - just good ol' integer zero. I know Javascript doesn't have true integers, but you get my drift.So the above code throws an error:You have entered an Invalid Field Value 0.0 for the following field: custpage_colremainingreleaseqty
I didn't enter 0.0, I entered 0. This is very annoying. I have found that passing in an instance of Number constructed with my desired value will satisfy NetSuite's (buggy?) requirements, but littering your code withnew Number(0)
is ugly and stupid.Anyone out there have a better way to deal with this?