The CreatorCon Call for Content is officially open! Get started here.

How to show a message in the catalog item form

marabin
Kilo Contributor

Hi everybody,

I have to show a message in my catalog items form. This message has to be in html format because is a bit log and the customer wants to see Underline and break-line.

I created the following catalog client script, but it doesn't work.          

function onChange(control, oldValue, newValue, isLoading){

var choiceValue = g_form.getValue('var_1');

var knowledgeMessage = "<u>Service Availability Window<u>: h24 <br>

<u>Maintanance Window<u>: once every three months and Sunday redslot <br>

<u>Backup Weekly<u>: retention 30 days <br>

Backup Monthly: retention 12 months <br>

";

if (choiceValueNeededFor != 'none') {

  if (choiceValueNeededFor == 'application') {

            g_form.showFieldMsg('var_1', knowledgeMessage,'info');  

  }

   

}

}

Please, could you help me? Thanks a lot.

Mara Bin

1 ACCEPTED SOLUTION

amlanpal
Kilo Sage

Hi Mara,



You can achieve this requirement by using a new Variable of type Macro. I have answered similar question earlier, please refer that here: Annotations without a variable field on Record Producer .



Again to use the HTML text, such as <a> tag or <br> tag, you need to change the system property (change it to false) 'glide.ui.escape_text' for this. Note: Please do remember that it will change globally. Please refer section 3 here: http://wiki.servicenow.com/index.php?title=High_Security_Settings



I hope this helps. Please mark correct/helpful based on impact


View solution in original post

10 REPLIES 10

marabin
Kilo Contributor

Thank you Mohan. For the Service Now POrtal i think this one is the correct way to proceed. I will try it.


regards


Mara