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
Try selecting the line and set the value , In netsuite for current record they prefer to use select line and set values
var records = context.currentRecord
var lineNum = records .selectLine({
sublistId: 'custpage_sublist',
line: 0
});
records.setCurrentSublistValue({
sublistId: 'custpage_sublist',
fieldId: 'custpage_id',
value: true,
ignoreFieldChange: true
});
records.commitLine({
sublistId: 'sublistidentire'
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With