record producer dynamic message with link

bradwestvig
Giga Guru

We currently have a record producer that creates new incidents based up values selected.   What our business would like to do is have a message pop up when a certain value is being selected.   In this message they want a link to the external site where this type of incident will be handled.  

Any ideas on how I can get a web link embedded in the message?

I tried to adding an HTML field on the page and used catalog UI policies to show the field when the value is selected.   But for some reason the html link option in the variable isn't showing up.   I'm sure people have other ways of accomplishing this.

1 ACCEPTED SOLUTION

Abhinay Erra
Giga Sage

Create macro and put your hyperlink there. Then create a variable of macro type and use that macro in there. Then you could create an onChange client script and put this script in there to hide/show variable


g_form.setDisplay('variable_name',false);



Sample UI macro code:


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


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


<a href="http://www.w3schools.com">Visit W3Schools.com!</a>


</j:jelly>



1.PNG


find_real_file.png


View solution in original post

2 REPLIES 2

Geoffrey2
ServiceNow Employee
ServiceNow Employee

You   can do this with GlideDialogWindow.   This allows you to use a Client Script to call a UI Page as a popup. You can pass parameters to the UI page to generate dynamic content.


GlideDialogWindow API Reference - ServiceNow Wiki



Client Script:


var gdw = new GlideDialogWindow('ui_page');


gdw.setTitle('my_title');


gdw.setSize(750,300); // w, h


gdw.setPreference('parm1', 'value1');


gdw.setPreference('parm2', 'value2');


gdw.render();



UI Page:


<?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 value1 = String(RP.getParameterValue('sysparm_parm1'));


              var value2 = String(RP.getParameterValue('sysparm_parm2'));


      </g:evaluate>



      <p>value1: ${value1}</p>


      <p>value2: ${value2}</p>



</j:jelly>


Abhinay Erra
Giga Sage

Create macro and put your hyperlink there. Then create a variable of macro type and use that macro in there. Then you could create an onChange client script and put this script in there to hide/show variable


g_form.setDisplay('variable_name',false);



Sample UI macro code:


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


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


<a href="http://www.w3schools.com">Visit W3Schools.com!</a>


</j:jelly>



1.PNG


find_real_file.png