Create a subtab in a record using user event script.

In the beforeLoad() entry point in the user event script, we can use the below code and add fields to the sublist using addField() and set values to those fields.

                let employeeForm = scriptContext.form;
                employeeForm.addTab({
                    id: 'custpage_jj_employee_tab',
                    label: 'Employee Details'
                });
                let employeeSublist = employeeForm.addSublist({
                    id: 'custpage_jj_employee_sublist',
                    type: serverWidget.SublistType.LIST,
                    label: 'Employee Details',
                    tab: 'custpage_jj_employee_tab'
                });
                employeeSublist.addField({
                    id: 'custpage_jj_employee_name',
                    type: serverWidget.FieldType.TEXT,
                    label: 'Resource'
                }).updateDisplayType({ displayType: 'DISABLED' });

Leave a comment

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