HTML in System UI messages

gerald_c
Kilo Explorer

I'm using a system UI message in an installation exit. This will be used to display the message which contains an email address when the account of a user is locked. I'm trying to output the email address using <a href="mailto> tags but as the message field on the sys_ui_message table is of type String, it's not rendering the HTML. Is there any way to go around this without changing the type of the field?

5 REPLIES 5

dave_slusher
ServiceNow Employee
ServiceNow Employee

As I think through the possible workarounds, they all seem more complicated than is reasonable. Is the landing page after this the login page but with the locked out message? In the installation exit, you could put that error message in the GlideSession object. Then, you could put a bit of client side script on the login page to call a simple Ajax handler to extract that and display it if it exists. That seems like it would work but like I said, seems complicated for your needs.


Bhupinder1
Giga Expert

Hi Gerald,


May be this works for if you are trying to display the message on form header, if you can combine the UI message and below method in installation exit-



gs.include("FormInfoHeader");


var msg = new FormInfoHeader();


msg.addMessage('<b>Account Locked</b>'+gs.get.getMessage('My Message'));     // this method can accept html messages



This can be workaround, if it fits your requirements.


Hi there,



Looks like one of our front end guys was escaping html tags for messages for some reasons. It's all fixed now.



Thanks


tbales
Kilo Contributor

May I ask how you identified and corrected this issue.   I might have the same problem.