How to set sublist value when using in client script. I tried all the method but it's not working and returning the same error.
fieldChanged: function(context){
var record = currentRecord.get();
//var record = context.currentRecord; // not working
if(context.fieldId =='custpage_cancel'){
var objSublist = record.getSublist({ //returns sublist obj but can not set
sublistId: 'custpage_sublist'
});
objSublist.setSublistValue({ // Not working ERROR: objSublist.setSublistValue is not a function
fieldId : 'custpage_id',
line : 0,
value : true
});
// record.setSublistValue({ // Not working ERROR: objSublist.setSublistValue is not a function
// sublistId: 'custpage_sublist',
// fieldId: 'custpage_id',
// line: 0,
// value: true
// });
}
}
ERROR: Screenshot