change the position of a virtual field in Sublist

For adding a virtual field via Userevent to the item sublist.

To specify the position of the Virtual field to show.

                   let form = scriptContext.form;
    
                    // Add a custom field to the Item sublist
                    let itemSublist = form.getSublist({ id: 'item' });
    
                    let dropField= itemSublist.addField({
                        id: 'custpage_bill_of_materials_in_so',
                        type: serverWidget.FieldType.SELECT,
                        label: 'Select Bill of Materials',
                        // source:'BOM'
                    });

                    itemSublist.insertField({
                        field: dropField,
                        nextfield: 'item' 
                    }); // this will make the field to appear before the item field in the sublist


Leave a comment

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