Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Onload client script to insert a url link on normal change request

EPoole954
Tera Contributor

I need to create a onload client script that inserts a clickable "Knowledge Article" url link with the title on a "Normal" change request record and placed under a certain field. Below is the code I produced but I am not sure what I am missing, Can you help??

5 REPLIES 5

Ankur Bawiskar
Tera Patron
Tera Patron

@EPoole954 

showFieldMsg() doesn't support adding link or HTML tags, but there is a workaround using DOM manipulation

check this, Note: DOM manipulation is not recommended practice

how to show URL link in field message when option is selected in dropdown list on catalog item 

OR

you will have to use g_form.addInfoMessage() and show link

How to add hyperlink into info message 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

@EPoole954 

Hope you are doing good.

Did my reply answer your question?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Ankur Bawiskar
Tera Patron
Tera Patron

@EPoole954 

Another way is to use form annotation and there you can include link

Administering form annotations 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Rafael Batistot
Kilo Patron

Hi @EPoole954 

 

var link = '<a href="https://www.nba.com/teams" target="_blank">official website here.</a>'

 

https://blog.snowycode.com/post/how-to-add-a-hyperlink-to-info-message-addinfomessage-in-servicenow#...

If you found this response helpful, please mark it as Helpful. If it fully answered your question, consider marking it as Correct. Doing so helps other users find accurate and useful information more easily.