How can it call a popup from a server side UI Action

irenechen
Mega Contributor

Hi,

We have a server side UI action to updating list value, and base on the updated value to call the popup for users additional action.

I use the GlideDialogWindow in the UI action, it's only work when the UI action is configure as client callable.   Could you please advise the possible resolution and sample code?

Thanks,

Irene

4 REPLIES 4

Michael Ritchie
ServiceNow Employee
ServiceNow Employee

Dialog windows can only be presented from client side scripts.


irenechen
Mega Contributor

Thank you Michael, I understand that. But we need to perform below logic in the server side UI action : Server side update -> get additional information from GlideDialogWindow -> continue with other additional server side update.  

We do have GlideDialogWindow code and UI page defined, but the problem is when the UI action "Client" checked, the GlideDialogWindow code working fine, but the server side update code won't work; if the UI action "Client"   unchecked, the GlideDialogWindow code won't work, but the server side update code work.



Could you please advise if there's other resolution for it?



Thanks,


Irene


Hi Irene,



The server side code before the the GlideDialogWindow has to be moved over to a GlideAjax-> Script Include.





irenechen
Mega Contributor

Hi Srinivas,



Thanks for your suggestion. I have tried that as well.   It's ok to move the server side code to GlideAjax, and call it from client side. In this case,   the form update will be lost, it seems when the UI action ran, it applied all changes of the form to DB first, then started with the code in the UI actions. Is there a way that I can keep the form updated before the GlideAjax code run?



Thanks,



Irene