- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2023 12:50 AM
Hi,
I have a requirement to raise a pop up when user login per session. The UI page functionality works fine but when the user login the pop does not come up
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2023 06:19 AM
@Alon Grod To show popup after login page there are no suggested solutions. The only way is to create the global ui script and add the modal in that.
The issue with this approach is that the global ui script gets attached to all the pages we open in native ui. And the popup may open in all the pages.
So you need to restrict the popup to be visible only once using session. The functions putClientData and getClientData.
Please mark as correct answer if this solves your issue.
ServiceNow Community Rising Star, Class of 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2023 06:19 AM
@Alon Grod To show popup after login page there are no suggested solutions. The only way is to create the global ui script and add the modal in that.
The issue with this approach is that the global ui script gets attached to all the pages we open in native ui. And the popup may open in all the pages.
So you need to restrict the popup to be visible only once using session. The functions putClientData and getClientData.
Please mark as correct answer if this solves your issue.
ServiceNow Community Rising Star, Class of 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2023 01:04 AM
@Alon Grod Add the script like below
UI Script:
var ga = new GlideAjax('SessionUtil');
ga.addParam('sysparm_name', 'showTermsAndCondition');
ga.getXML(showResponse);
function showResponse(response) {
var answer = response.responseXML.documentElement.getAttribute("answer");
if (answer == "true") {
var gdw = new GlideDialogWindow('terms_and_condition');
gdw.setTitle('Test');
gdw.setSize(750, 300);
gdw.render();
}
}
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">
<div>terms and condition</div>
<g:dialog_buttons_ok_cancel ok="return ok()" cancel ="return cancel()"/>
</j:jelly>
UI Page Client Script:
ServiceNow Community Rising Star, Class of 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-29-2024 05:44 AM
Hi @jaheerhattiwale currently the class Glide dialog window has been depricate d . Si, how to achieve this now . Pls suggest