Hey all, seem to have an issue atm, on beforeload ...
# suitescript
a
Hey all, seem to have an issue atm, on beforeload I want to set a sublist value: cRecord.setSublistValue({ sublistId: 'item', fieldId: 'custcol_wrx_ci_htn', line: i, value: itemRec.getValue({fieldId: 'custitem14'}) }); cRecord is: var cRecord = scriptContext.newRecord Everything flows, no errors and if I dump the value to the log it shows correctly however when the record loads the value is still not set. Do I need to commit the line or something? I usually work with this on the client side.
For archive purposes, you can not interact with a new record on before load from a user event script per the documentation. All changes will be ignored. You can use workflows however to set field values before a record loads, which is faster than pageinit client side when loading other records.