FAgudelo
07/29/2020, 7:36 PMdefine ( ['N/log', 'N/record'] ,
function(log, record) {
function myBeforeLoad(context) {
var woRecord = context.newRecord;
var createdFromSO = woRecord.getValue({fieldId:'createdfrom'})
var soRecord = record.load({
type: record.Type.SALES_ORDER,
id: createdFromSO,
isDynamic: true,
});
var salesOrderValue = soRecord.getValue({fieldId:'tranid'});
var testForScript = woRecord.getValue({fieldId:'custbody_jh_test_for_script'});
woRecord.setValue({fieldId:'custbody_jh_test_for_script',value: salesOrderValue,ignoreFieldChange:true});
}
return {
beforeLoad: myBeforeLoad
};
});
I've been trying to set the transaction ID from my sales Order to my Work Order but unfortunately when I set the value it is blank for some reason. Is their a reason why in 2.0 ?ehcanadian
07/29/2020, 7:38 PMbeforeLoad
, only when they are new records.FAgudelo
07/29/2020, 7:40 PMSandii
07/29/2020, 7:42 PMFAgudelo
07/29/2020, 7:45 PM