RE: In SS2.x, can you set a field value in beforeLoad of a User Event script?
Answered
Hello!
So in a User Event script in the beforeLoad function I need to set a custom Transaction Body Field value, like this:
var newRecord = context.newRecord; newRecord.setValue({ fieldId: 'custbody_my_custom_field', value: true // or false });
Logging the result of the above, I can see the value change, but it does not persist through the entire page load, and always returns to the default state. I have ‘Store Value’ checked on the field’s setup. So, is it just not possible to set a field value in beforeLoad and have that value persist?
Thanks for any help!!
Leacc, thanks! Yes, I did so in a newly created record, didn’t try on EDIT. Mreser, you might want to try with a workflow instead.