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??

4 REPLIES 4

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

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

Mark Manders
Mega Patron

I would use the g_form.addInfoMessage() to show a link on the form. It won't be on the field, but it is visible. The only other way is through DOM manipulation, but the advise is to use that as little as possible.


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark