The CreatorCon Call for Content is officially open! Get started here.

Getting error GlideDialogWindow is undefined when used in UI Action with client checkbox selected

zuber_crest
Kilo Contributor

Hello,

I am getting an error GlideDialogWindow is undefined when used in UI Action with client checkbox selected. I have created a function named openw() in my UI action script which creates an object of it. And this function is called on click. Also I have created an empty UI page named "Set Time Range".

onclick: openw()

Script:

function openw() {

var dialog = new GlideDailogWindow("Set Time Range");

dialog.setSize(400,400);  

dialog.setTitle("");

dialog.render();

}

Error which I am getting: "Uncaught ReferenceError: GlideDailogWindow is not defined" in browser console on triggering UI action in my App.

I am following exactly that is written in API reference - Client Side. Please guide me what am I doing wrong.

Thanks.

8 REPLIES 8

OK, sorry about that. Just do a search on Service Portal> Widgets where client controller contains spmodal and you should find some examples.


Ankur Bawiskar
Tera Patron
Tera Patron

Hi Zuber,



Is this error coming for portal page?


Because I think calling UI page in portal doesn't work in scoped app.



GlideDialogWindow in service portal


ReferenceError: GlideDialogWindow is not defined



Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.


Thanks


Ankur


Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Ok. Is there a way to provide dialogs in service portal scoped application?


agopalrao
Mega Contributor

The GlideDialogWindow API Document says as follows

Note: GlideDialogWindow does not function with List v3. Either use List v2 or the GlidModalV3 API.

https://docs.servicenow.com/bundle/kingston-application-development/page/app-store/dev_portal/API_reference/GlideDialogWindow/concept/c_GlideDialogWindowAPI.html