I’m trying to access a custom sublist via scriptin...
# suitescript
m
I’m trying to access a custom sublist via scripting and in initial tests, it’s returning a line count of 0. There is currently only one parent record and it has one item in the sublist when viewed in the UI. They’re set up like this: Parent record:
customrecord_lockbox_payments_parent
Child record:
customrecord_lockbox_payments
Child record field:
custrecord_lbp_parent_record
(Type: List/Record of SCG Lock Box Payments Parent, Record is parent) When I try to access the sublist via scripting, I’m using this code:
Copy code
var parent = record.load({ type: 'customrecord_scg_lockbox_payments_parent', id: 1 });
var lineCount = parent.getLineCount({ sublistId: 'recmachcustrecord_lbp_parent_record' });

log.debug({ title: lineCount });    // logs '0'
Did I miss something setting up this relationship?
r
To access the sublist you have to check the permission "Allow Child Editing" checkbox in the children records to get this information
👍 1