I'm working with the Contracts Renewals module and I'm trying to set some line values on the Contract Item Sublist based on the originating Sales Order. However, it looks like I'm unable to get the "Original Transaction" and "Original Line No" fields using getSublistValue in a User Event script?
The item field comes back fine but originalTransaction/originalLineNo just come back undefined. Is there a better way to do this? or is there a different fieldId I should be using?
I was also looking into trying to use the subrecord APIs but I couldn't figure out what fieldId I was suppose to use to get the Contract Item subrecord from the Contract records sublist. Anyone know what the fieldId should be?
var contractRecord = context.newRecord; var contractItemCount = contractRecord.getLineCount({ sublistId: 'recmachcustrecord_ci_contract_id' }); for (var i = 0; i < contractItemCount; i++) { var item = contractRecord.getSublistValue({ sublistId: 'recmachcustrecord_ci_contract_id', fieldId: 'custrecord_ci_item', line: i }); var originalTransaction = contractRecord.getSublistValue({ sublistId: 'recmachcustrecord_ci_contract_id', fieldId: 'custrecord_ci_original_transaction', line: i }); var originalLineNo = contractRecord.getSublistValue({ sublistId: 'recmachcustrecord_ci_contract_id', fieldId: 'custrecord_ci_original_so_lineno', line: i }); }