Sublist in Suitelet Form

SubLlst can be used to display a list of data in the suitelet form. A basic format for displaying a sublist in a suitelet form is given below:

Initially we need to create a form:

let form = serverWidget.createForm({ title: ‘Details’ });

Then create the sublist:

let sublist = form.addSublist(

{

  id: ‘custpage_sublist1’,

  type: serverWidget.SublistType.LIST,

 label: ‘Sublist 1’

});

Then add the fields for the sublist:

sublist.addField(

{

  id: ‘custpage_field _1’,

  type: serverWidget.FieldType.TEXT,

  label: ‘Field 1’

});

sublist.addField(

{

  id: ‘custpage_field_2’,

  type: serverWidget.FieldType.INTEGER,

  label: ‘Field 2’

});

Then set the values to the sublist:

sublist.setSublistValue(

{

  id: ‘custpage_field_1’,

 line: 0,

  value: ‘Field 1 Value’

});

sublist.setSublistValue(

{

  id: ‘custpage_field_2’,

  line: 0,

  value: 10

});

Leave a comment

Your email address will not be published. Required fields are marked *