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
04-09-2014 04:26 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2014 11:49 AM
Yes, that is the one I tried first, thanks. It works great from the form, but unfortunately does not work from the list view, as the list view does not execute the HTML.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2014 02:13 AM
Are you trying to create something similar to "Preview link" field in Catalog Item records?
Blog: https://sys.properties | Telegram: https://t.me/sys_properties | LinkedIn: https://www.linkedin.com/in/slava-savitsky/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2014 05:23 AM
Have you tried a calculated field?
Blog: https://sys.properties | Telegram: https://t.me/sys_properties | LinkedIn: https://www.linkedin.com/in/slava-savitsky/