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

LearnerSubho
Mega Guru

Hello Randeep,



Try this :



    var gdw = new global.GlideDialogWindow('display_incident_list');



Thanks,


Subhankar


Please like or mark it helpful / correct based on the impact of this reply.


Subhankar,



This line here on the constructor     var gdw = new GlideDialogWindow('display_incident_list'); where/what is 'display_incident_list' this code works for me... and thought that display_incident_list was an UI page, but when I attend to look for it, I found none item with that name. Can you please help me understand it this. Thx



randeepnath
Mega Contributor

Hi Subhankar



Thanks for the reply !!



I have already tried this, but not possible as this is calling from client side. Can we call the same in server script ?


Ashutosh Munot1
Kilo Patron
Kilo Patron

Where have you written this code.