Display list in Dialog window when a UI Action is pressed

EdwinCoronado
ServiceNow Employee
ServiceNow Employee

Hello, I want to display the asmt_metric table as a list in a GlideDialogWindow. The code below is what I have. "GlideDialogWindow( )" takes a UI Page as the parameter. However I was under the impression that if you use the "setPreference('table', 'table you want to display')" it would sort of ignore the passed UI page and display the table you are asking for. It currently only shows the gray list header bar but doesn't show any records. That's where I'm having trouble. Any advise would be appreciated. Thanks.

function popDialog() {

      var gd = new GlideDialogWindow('show_list');

      gd.setTitle('Questions');

      gd.setPreference('table', 'asmt_metric');

      gd.setPreference('sysparm_view', 'default');

      var query = 'active=true';

      gd.setPreference('sysparm_query', query);

      gd.center();

      gd.render();

}

4 REPLIES 4

Chuck Tomasi
Tera Patron

Hi Edwin,



I'm not showing show_list as an OOB UI page so I have no reference to go on for parameters or how to pass them in. Can you provide some insight where this UI page came from?



https://instance.service-now.com/show_list.do



should produce something, but I get the standard ServiceNow 404



find_real_file.png


Hi Chuck, 

 

I believe that code is included in an OOB UI Macro. It calls the show_list (I dont know what it is but i cannot find it in UI Pages or UI macros)

 

That makes me believe that the show_list page is OOB. It would be of great help if you could tell us where is it stored.

 

This is the UI Macro the calls it -> https://instance.com/nav_to.do?uri=sys_ui_macro.do?sys_id=6020e170d73031008d7dc23c5e61031b

 

Thank you.

Abhinay Erra
Giga Sage

Can you post your UI page here.


Geoffrey2
ServiceNow Employee
ServiceNow Employee