I've got a SS2.0 User Event script that runs before Sales Orders are submitted.
The script loops over every line item on the order and sets a line value like below:
context.newRecord.setSublistValue('item', 'custcol_XXXXX', i, 2);
Where 'custcol_XXXXX' is a List/Record type, referencing a Custom List.
Nothing related to this has changed for months, and it worked fine through yesterday afternoon.
Today, the error "Invalid custcol_XXXXX reference key 2.0" began showing up when saving Sales Orders.
Adding quotes around the value (2) which references the internal id of the list item was enough to resolve my issue:
context.newRecord.setSublistValue('item', 'custcol_XXXXX', i, '2');
But could anyone tell me what might've changed overnight to cause this?
Edit: I should note that the error doesn't occur immediately from that function call, but rather after the script has executed and the form submits the incorrect reference key value.'
Edit2: Changing the script to 2.1 also works, so this is SS2.0 specific.