I'm using the NetSuite Contracts Renewals module and trying to make a NetSuite User Event script (SuiteScript 2.0) that sets a custom field value on the Contract Item record based on the original sales order.
The script works fine when I edit/save the record manually but when I use the "Create Contract Item" button on the Contract record I get the following error:
INVALID_FLD_VALUE You have entered an Invalid Field Value 8.0 for the following field: custrecord_count
The field is definitely an Integer field and it makes no sense that it would work in one context but not the other. I even tried hardcoding a value but no dice.
Anyone have any ideas?
Here's an example to illustrate how I'm attempting to set the value:
var contractItemRecord = context.newRecord;
contractItemRecord.setValue({
fieldId: 'custrecord_count',
value: 8
});