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”

Sublist

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'});}
}
Rookie Asked on June 29, 2021 in SuiteCloud.
Add Comment
0 Answer(s)

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.
  • This site made possible by our sponsors:   Tipalti   Celigo   Limebox   Become a Sponsor