Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to call GlideDialogWindow from application scope

randeepnath
Mega Contributor

I tired to call GlideDialogWindow from Global scope, it is working fine (see the following code ), but the same code when we are calling from application scope not working - Any idea

function popupDispList() {

    //Initialize the GlideDialogWindow

    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();

}

How we can call this from the application scope ???

Thanks in Advance !!

13 REPLIES 13

randeepnath
Mega Contributor

we can get the incident number - g_form.getValue('number')


randeepnath
Mega Contributor

Can we create a UI page with all the functionalities as we have in the popupdisplay list ...   If you have sample code could you please help me to get that..



Thanks in advance...


vongernation
Giga Contributor

This is a late response, but I came across this while searching for a solution for my GlideDialogWindow, which worked fine while in Global Scope, but did not work once in its own custom scope.   Sharing my fix for future reference...



NB: I was using a custom scope and custom object, not Incidents, as shown in the original question.


In my case, the use of "global.GlideDialogWindow" did not fix the problem.


Instead, only two changes needed to be made:


- Add the scope of the UI Page in its name


- Change <scope>.<ui page id> to <scope>_<ui page id>



so...


var gdw = new GlideDialogWindow('my_dialog_uipageid');


becomes


var gdw = new GlideDialogWindow('x_abc_myscope_my_dialog_uipageid');


where 'x_abc_myscope' is your application scope.




Hope that helps.


Thanks.