how can a list of records in one table can be show in other form using a button

manojlakshmanas
Kilo Expert

I need to show a popup in incident   from to show all the computer present in the computer table,how can i perform this with the help of glide window.

mainly all this must work in customized application scope

Please help me to solve it

this script i have used and this is showing pop up with exact information while using same script in global scope.But while working with private application scope this popup show as mentioned in the second image...  

Please help me to solve it

eerrr11.JPGerrrr2.JPG

1 ACCEPTED SOLUTION

manojlakshmanas
Kilo Expert

This script helped to get the data from table with a query values obtained from form.


function popupList() {


  var num = g_form.getValue('field name');


    var tableName = 'table name from which to query';


    var url =   tableName + '_list.do?';


    url += 'sysparm_query=device_id=' + num;


    //Open the popup


    var w = getTopWindow();


    w.popupOpenFocus(url, 'related_list',   950, 700, '', false, false);


}


note:


table and the buttons are created in the same application scope  


View solution in original post

8 REPLIES 8

vims
Kilo Expert

Create a UI Page. Inside UI page you can use <g:ui_reference> tag to show computer table as reference.



for ex: <g:ui_reference name="computer" id="computer" table="cmdb_ci_computer" />


ghsrikanth
Tera Guru

      Hi,


      You can write this by GlideDialog window and implementing in UI Action button, there are many OOB UI Actions having GlideDialog window implementation in them -


      You can go to list of UI Actions and query the script field for *GlideDialog


Displaying a Custom Dialog - ServiceNow Wiki



https://<yourinstancename>.service-now.com/sys_ui_action_list.do?sysparm_query=%5EscriptLIKEglidedialog&sysparm_first_row=1&sysparm_view=&sysparm_choice_query_raw=&sysparm_list_header_search=true#



Hopefully it helps


Hi       Srikanth,


Thanks for the answer i have used this in the UI Action script but i am not able get the data from the computer table i have used this code. this is working when i created the same button on global application scope while i try to create it in application scope i am unable to get the same answer.



this the code i have used



function pop(){


var gdw = new GlideDialogWindow('display_incident_list');


      gdw.setTitle('Incidents');


      gdw.setPreference('table', 'incident_list');


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



      //Set the table to display


      var num = g_form.getValue('number');


      var query = 'active=true^priority=1^number!=' + num;


      gdw.setPreference('sysparm_query', query);



      //Open the dialog window


      gdw.render();


}


Could you please check the table which holds the computer information has proper access settings enabled in the table dictionary.


It should be accessible from another application scope.



Application Access Settings - ServiceNow Wiki


As you have mentioned, the functionality is working and its the access issue



Hope it helps