Has anyone seen this before - when a before submit OR after submit script can not see some fields on a record that are absolutely populated?
Here's sample code (if there's a small typo - that's not it - I just whipped this into this post fast):
var record = nlapiGetNewRecord()
nlapiLogExecution('DEBUG', 'Show me the record ID', record.getId());
nlapiLogExecution('DEBUG', 'Show me value 1', record.getFieldValue('custrecord_value1'));
nlapiLogExecution('DEBUG', 'Show me value 1 text', record.getFieldText('custrecord_value1'));
The execution log output:
Show me the record ID 12345
Show me value 1
Show me value 1 text
custrecord_value1 on the custom record is type Integer...
For the record that's being looked at - it's absolutely populated.
Other fields on the record that are populated also return null values. -but have values in them that display in the UI.
Change things around slightly for an afterSubmit - and things still are null.
Take all code out of it - put a workflow in place that pulls from the field - and has this wrapped around it nvl({custrecord_value1},0), the result is 0.
How is it a custom field on a custom record that has a value in it from the UI is null for scripts and workflows? (Again - field type is Integer and there is not a formula populating it - it's a boring old Int field).
Has anyone ever seen something like this - it's a real head scratcher!