how to create sublist same like “Print Checks” page.
I try to create a sublist the same as “Print Checks” when the account change (dropdown) then render the sublist, but I got the error message “TypeError Cannot read property ‘0’ of undefined”. if change sublist type to “INLINEEDITOR” work. but I need the sublist to display the same “List”
var selAccount = form.addField({
id : 'custpage_account',
type : serverWidget.FieldType.SELECT,
label : 'Account'
source : 'xxxx'
});
var sublist = form.addSublist({
id: 'custpage_trans_sublist',
type: serverWidget.SublistType.LIST
label: 'List'
});
[ClientScript]
function fieldChanged(context) {
...populate sublist
if (context.fieldId == 'custpage_account') {
var rec = currentRecord.get();
rec.selectNewLine({
sublistId: 'custpage_trans_sublist'
});
rec.setCurrentSublistValue({
sublistId: 'custpage_trans_sublist',
fieldId: 'custpage_trans_number',
value: '000999',
forceSyncSourcing:true
});
rec.commitLine({sublistId: 'custpage_trans_sublist'});}
}




