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.

Show popup window once user login

KarankiS
Tera Contributor

Hello Experts,

I have a requirement to show popup window once user with a specific role login.

Have written below script, but it didn't work, can you please help me here?

UI Script: Global

var ga = new GlideAjax('ClientUtil');
ga.addParam('sysparm_name', 'validateUserRole');
ga.getXML(showResponse);

function showResponse(response) {
    var answer = response.responseXML.documentElement.getAttribute("answer");
    if (answer == "true") {
        var gdw = new GlideDialogWindow('test_window');
        gdw.setSize(750, 350);
        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">
<p>
<span> #alert message</span>
</p>
<button class="btn btn-primary" onclick="ok()">OK</button>

</j:jelly>
 Client script
function ok(){
    GlideDialogWindow.get().destroy();
}

 

 

0 REPLIES 0