Display hyperlink on form
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2023 10:27 PM
Hi ,
I need to display a hyperlink on my form.
Currently the field is displaying entire url.
How can i display the hyperlink without DOM manipulation ?
My current ui policy script :
var message = "Click me!";
document.getElementById("<table_name>.<field_name>_link").innerHTML = message;
I am working in scoped application. The code above is working fine in global but not in scoped.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2023 12:51 AM
then the only way is to use DOM manipulation
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2023 11:41 PM
Hi @Rj27 ,
Instead of this you can use Info Message to display hyperlink, example:
var link = '<a href="incident_list.do">List Link</a>';
gs.addInfoMessage('Incidents: ' + link);
If my answer has helped with your question, please mark it as correct and helpful
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2023 12:44 AM
Hi Karan,
My requirement is to display like this..this is working fine in global but not in scope