GlideDialogForm and GlideDialogWindow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2017 06:18 AM
Hi,
On the incident form, I am using a UI action to call a glideDialogForm from another table.
Currently using this script:
//dialog opens with previous justification and deletes it on submit
if(lookup.u_category != '') {
var dialog = new GlideDialogForm('Escalate incident', 'u_incident_category_area_lookup', setCatField);
dialog.setSysID('-1'); //Pass in -1 to create a new record
dialog.addParm('sysparm_query','u_incident='+inc + '^u_category='+category + '^u_area='+area + '^priority='+priority + '^u_work_notes='+workNotes); //Set form sys id and other fields in lookup form fields
dialog.addParm('sysparm_view', 'popup_view'); //Specify a form view
dialog.addParm('sysparm_form_only', 'false'); //Show related lists
// dialog.removeCloseDecoration(); //remove the close cross from the dialogwindow
dialog.render(); //Open the dialog
}
}
target table is u_incident_category_area_lookup
A coupe of issues I encountered:
1. dialog.addParm('sysparm_form_only', 'false'); -> does not work. The related list on the target table does not show in the window that pops up.
2. How do I add a "Cancel" button to the pop up form?
I wanted to use a glideDialogWindow, but could not understand how to create a UI Page that refers to the target table and get the form to load properly - so any help/example would be very welcome.
harel

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2017 05:12 PM
Hi Harel,
I found this article ui action cancel with glide dialog window so helpful along with the servicenow wiki Displaying a Custom Dialog - ServiceNow Wiki .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2017 08:17 AM
Hi bharath_kumar,
Thanks; however, I am using GlideDialogForm, not GlideDialogWindow.
Harel

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2017 02:13 AM
Hi
When you create a new record on a table, you don't have access to related lists; Line 4 of your code explicitly states you are creating a new record, which explains why the property in Line 7 has no effect.
Popup forms don't normally need Cancel buttons, as you would use the close button in the top right hand corner.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2017 09:25 AM
Hi James,
Thanks for your insights.
You are correct, however, commenting out line 04 does not change the behavior. I tried it with both related lists and with embedded lists. It does not work for the related lists, but it does for embedded lists.
The record on 'u_incident_category_area_lookup' already exists when the glideDialogForm is created. The pop up form shows the record after it has been created, but not the related list. It does, however, show it as an embedded list. For new records - I agree: related lists do not exist until the record is saved, but this is not the case. What the glideDialogForm does is show an already existing record - otherwise why is it showing the embedded but not the related list?
As for the close / cancel button - I know, that's why I asked...
harel