It's been a long day and I'm feeling a little loopy, but I'm pretty sure if I set the value of a field in a BeforeLoad script I should see the value when the record is displayed, no?
From the help:
3. The database loads the requested information into the application server for processing. This is where the before load operation occurs – before the requested data is returned to the client.
4. The client receives the now validated/processed before load data
The code:function OnBeforeSubmit(type) { if(type == RECORD_STATE.DELETE) { return; } SyncFields(); } function OnBeforeLoad(type) { SyncFields(); } function SyncFields() { var physOrder = nlapiGetNewRecord(); log('processing Physician's Order ' + physOrder.getId()); physOrder.setFieldValue('custrecord_physorder_length_of_need', 99); } When I save a record it sets the value, but when I view a record it doesn't.This seems incorrect, but honestly I'm a bit faded so it could be this is the way it's supposed to work? In which case... what would be the point of the BeforeLoad script?Hmmm...