Script to add custom button to the sublist line in suitelet

The following code is used to add custom button in the sublist line in suitelet page

let objForm = ui.createForm({ title: 'Select Items', hideNavBar: true });
let objSublist = objForm.addSublist({ id: "custpage_sublist_item", label: "Items: ", type: ui.SublistType.LIST });
let custpage_duplicatebutton = objSublist.addField({ id: "custpage_duplicate_add", type: ui.FieldType.TEXTAREA, label: "Duplicate", functionName: "addRow()" });

custpage_duplicatebutton.updateDisplayType({
  displayType: ui.FieldDisplayType.INLINE
    })
let buttonHtml = '<button id="addItemLine" type="button" style="cursor:pointer;background-color : #337ab7;color : whitesmoke;display: inline-block;padding: 6px 12px;margin-bottom: 2px;font-size: 14px;font-weight: 400;line-height: 1.42857143;text-align: center;white-space: nowrap;vertical-align: middle;border: 1px solid #245580;border-radius: 2px;">Duplicate</button>';
 custpage_duplicatebutton.defaultValue = buttonHtml;

Leave a comment

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