Display value for URL in List View / Report
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2014 01:36 PM
Hello, I have been asked by a process owner to add a field to Project, which, when clicked from a report, would open a window of all tasks under that project. I have it figured out, but it's not pretty.
What I did was add a calculated field with the following calculation:
<code>
var link = "https://instance.service-now.com/pm_project_task_list.do?sysparm_query=parent%3D" + current.sys_id + "%5E";
javascript:"<a href=" + link + "> Tasks </a>";
</code>
It works great when you look at the field on the form. It shows up as "Tasks" and if you click on it, it directs you to the URL. The problem is that the lists and the reports are stripping the HTML (I'm sure it is to prevent HTML injection).
I need a way around this. I want the link to display in list and report view as 'Tasks' and be clickable. Also because it is not executing the HTMl in the table, the links are incorrect because of the a hrefs. I can replace all that with just the link itself, but that is very ugly when looking at it in a list.
Anyways, bottom line is that I want to replicate the a href functionality in the lists and reports. Any suggestions are welcome.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-17-2014 09:26 AM
I extended the calculated part to this:
"https://<instance>.service-now.com/nav_to.do?uri=task.do?sys_id=" + current.sys_id
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-04-2022 05:08 AM
The no_truncate dictionary attribute will solve the issue
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0853971