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

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


marabin
Kilo Contributor

Thank you a lot for the Annotations document. Really useful.


Now I've just to try it!



Regards


Mara      


Hi marabin ,



Please let me know if you face any issue while implementing the same.


Also, if your issue is resolved please mark my response as correct so that others with the same question in the future can find it quickly and that it gets removed from the Unanswered list.


If you are viewing this from the community inbox you will not see the correct answer button.   If so, please review How to Mark Answers Correct From Inbox View


Your link is not working

mohan91
Mega Expert

Hi Mara,



If you would like to   display the HTML content in service portal for the catalog item variable then create a new widget and embed the HMTL content. Finally, tag that widget to the required variable, the message will get displayed under that variable.