Adjust the Size of a field in Suitelet form with the native Suitelet method

Issue:

Usually, the standard size of the TEXT Type field and other types should be different when you simply add different types of fields in suitelet form with no special styling. So to make size corrections to make them all look alike.

But met with a case where updateDisplaySize() not working in Suitelet.

Solution:

Strictly mention the updateDisplayType() and if there is any updateLayoutType().

Adding a sample code snippet from suitelet here:

var description = Suieletform.addField( {
                        id: 'custpage_jj_description',
                        type: serverWidget.FieldType.TEXT,
                        label: 'Description'
                    } );

                    description.updateLayoutType( {
                        layoutType: serverWidget.FieldLayoutType.STARTROW
                    } );
                    description.updateDisplayType( {
                        displayType: serverWidget.FieldDisplayType.NORMAL
                    } );
                    description.updateDisplaySize( {
                        height: "20px",
                        width: "38.95px" // Set the desired width in pixels
                    } );

Leave a comment

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