Error Message query

Joshuu
Kilo Sage

Hi All,

 

We are populating an error message on the change form through a business rule. And if we open the same change form from report or if we reload the form the error message is not getting displayed.

 

How to display the error message to as soon as the form loads?

 

Please assist.

 

 

12 REPLIES 12

Brad Bowman
Kilo Patron
Kilo Patron

Use a Display Business Rule.

Hi @Brad Bowman  ,

 

Thanks for your response. I have tried both before and display but it is not working. 

 

below is my code. 

 

var messageallnew = '<b><font size="3">"The defined Change Request window overlaps Maintenance Window,"</font></b>' +
                '<b><font size="4">' + gr.schedule.name + '</font></b>' +
                '<b><font size="3">"Coordinate with the Technical Manager"</font></b><br>' +
                '<font size="3"><b>Primary Contact - ' + gr.schedule.u_pri_contact.getDisplayValue() + '</b></font><br>' +
                '<font size="3"><b>Secondary Contact - ' + gr.schedule.u_ec_contact.getDisplayValue() + '</b></font>';
            gs.addErrorMessage(messageallnew);

 

  

priyarao_0-1726592186795.png

 

A Display Business Rule is one in which When = display on the When to Run tab...

BradBowman_0-1726592546828.png

https://docs.servicenow.com/bundle/xanadu-api-reference/page/script/business-rules/concept/c_Busines... 

Hi @Brad Bowman  ,

 

Yes I was saying I have tried both 'before' and 'display' but not working.