How to set size of GlideModalForm?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2019 05:03 PM
I'm using GlideModalFormV3 and there doesn't seem to be a way to size the thing as there are no documented APIs to do this.
https://developer.servicenow.com/app.do#!/api_doc?v=newyork&id=c_GlideModalFormV3API
We can hack it via the callback and add the class "modal-lg" to the ".modal-dialog" node, but then the modal snaps after it loads to the smaller size and looks terrible.
With the new SN mandate to not use Jelly UI Pages, I'm out of ideas.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2019 05:10 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2019 05:10 PM
try doing below
var d = new GlideModalForm('dialog title', 'table_name_or_form_name', [callback on completion of submit])
d.setPreference('name', 'value');
d.setWidth("300");
d.render();

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2019 05:13 PM
you can also add height like below
d.setWidth("95%");
d.setHeight("95%");
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-05-2020 01:01 PM
For the GlideModalForm object, there is no setHeight function, and the setWidth function is hardcoded to return 'modal-95', no matter what you pass in.
GlideModalForm.setWidth:
ƒ (width) {
this.setSize(width);
}
GlideModalForm.setSize:
ƒ (width) {
this.size = 'modal-95';
}