Get an error during attempt to open GlideDialogWindow from UI Action in scoped application

yarick
Kilo Contributor

Trying to open GlideDialogWindow from UI Action in scoped application from Incident form. Get "page not found" error inside modal window.

UI Action has only client-side code.

UI Action code:

function onTranslateIncidentNoutes() {

    var dialog = new GlideDialogWindow("my_unique_dialog");

    dialog.setTitle("Translated comments and work notes");

    dialog.setSize(750, 750);

    dialog.setPreference("incident_id", g_form.getUniqueValue());

    dialog.render();

return false;

}

UI Page name: my_unique_dialog.

UI Page category: General

UI Page Direct - unchecked

UI Page HTML:

<?xml version="1.0" encoding="utf-8" ?>

<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">

  <g:evaluate var="jvar_id" expression="RP.getWindowProperties().get('incident_id')"/>

  <p>$[jvar_id]</p>

</j:jelly>

Error screenshot:

popup_error.png

As I understand system couldn't find my UI Page. But I don't understand why?

What I've missed?

Thanks in advance.

1 ACCEPTED SOLUTION

Brad Tilton
ServiceNow Employee
ServiceNow Employee

Hi Yarick,



Using the endpoint in my above screenshot worked in my test case like this:



Screen Shot 2017-02-23 at 8.26.35 AM.png



Screen Shot 2017-02-23 at 8.27.41 AM.png


View solution in original post

6 REPLIES 6

Brad Tilton
ServiceNow Employee
ServiceNow Employee

If your ui page is part of your scoped app, then its endpoint is going to be something like appnamespace.my_unique_dialog. The page itself should give you that info if you look at it.



Something like:



Screen Shot 2017-02-22 at 10.25.35 AM.png


Yes, thank you, I've seen it. I opened successfully it in new browser tab(url: https://my-instance..service-now.com/endpoint). And it works(I removed getting parameter on the UI page and left only static html). Also I putted it in textbox on error page and gone on it. It works too. Also I tried to create dialog window in the following way:



var dialog = new GlideDialogWindow("my_endpoint");



Unfortunately unsuccessful.


How can I use it for opening my UI Page in modal window?


Brad Tilton
ServiceNow Employee
ServiceNow Employee

Hi Yarick,



Using the endpoint in my above screenshot worked in my test case like this:



Screen Shot 2017-02-23 at 8.26.35 AM.png



Screen Shot 2017-02-23 at 8.27.41 AM.png


Thank you. I've already found workaround using



getTopWindow().popupOpenFocus(); method