Glide pop-ups - different approaches - Question / discussion

Tom Sienkiewicz
Mega Sage

Hi,

could someone knowledgeable shed some light on the usage of the different pop-up / window functions in SN?

I have a goal to recreate the Reference Tooltip SHIFT + hover functionality (a pop-up that looks like the screenshot below:)

find_real_file.png

The key requirements are:

1. Enable adding attachments

2. Pass some values from the parent form / related list to the pop-up window (so the fields are autopopulated on display).

Here is what I tried:

1. new GlideDialogWindow(); - obviously gives a lot of control as you can define the XML, HTML scripts etc. However I think you cannot just display a particular custom table form that way - you would probably have to mimic the fields, logic etc. Can be cumbersome.

2. new GlidePaneForm('Window title', tableName); - It basically opens a form for an existing, specified table (Icreated a custom approval table). Opens a fixed pop-up that cannot be moved around on the screen, pop-up does not disappear when you click outside the pop-up and disappears when you click submit. Also, it allows passing values from parent form using a callback function. See below:

find_real_file.png

It would be great if someone could explain the usage, best practice, options, attributes of this function in more detail.

3. new GlideDialogForm('Window title', tableName); - very similar to 2 (see below screenshot). The pop-up can be moved around the screen.

find_real_file.png

Ths is a very nice option and almost perfect for what I need. The only remaining challenge is how to enable adding attachments via this form - any suggestions? Apparently I cannot modify the underlying UI page as it is not showing on the UI pages list.

4. popupOpenStandard('URL to form'); - I thought this is what is used to open the original Reference Tooltip pop-up, but not quite... it opens a new browser window, see below:

find_real_file.png

The great thing is this contains the upper pane inluding attachments but I have no idea how to make it disappear on submit and how to pass values from underlying form other than by using the URL (which is not that great if I have to pass e.g. 200 sys_id numbers). Some more advice on how to apply this function to achieve the original effect mentioned atthe beginning would be great.

So, which ones do you use? Can you share some nice examples of using the described functions? Are there any other ones you know about?

3 REPLIES 3

Brad Tilton
ServiceNow Employee
ServiceNow Employee

It looks like you have a pretty good handle on this, but I think the SNCGuru site has the most examples of GlideDIalogWindow in action. There's also GlideModal which takes all the same arguments as GDW but displays a modal window rather than the GDW.



GlideDialogWindow Archives - ServiceNow Guru


Thanks Brad, I will have a look into this option.



It is a pity all of those functions aren't really documented in a clear way. I find that custom pop-ups and ui pages are necessary in most of the projects Ive been working on, since the clients' needs often exceed the configuring possibilities. If only I could find a way to easily enable attachments on any of those pop-up forms, I would be really happy.


Just to give anyone interested in a similar solution a heads-up, I used the new GlideDialogForm function to create a pop-up. In order to add attachments, I added a UI Action with the function to add attachments to the underlaying form and set it to show the button in both the upper pane and at the bottom of the form. The upper pane is gone in the pop-up, but the button at the bottom works just fine.


You can pass any value to the pop-up from other places using the call-back method described e.g. by SNCGuru.