- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-26-2021 01:37 AM
Hi,
We have a string field (description) on certain conditions, we are populating the description field with clickable LINK via BR.
The link is getting populated in plain text.
How can we make the text clickable?
Here is my script:
(function executeRule(current, previous /*null when async*/ ) {
var deepLinkGenerator = new global.MobileDeepLinkGenerator("agent");
var link = deepLinkGenerator.getFormScreenLink("472ceb7253b0330097a2ddeeff7b12f6", current.getTableName(), current.getValue("sys_id"));
current.setValue('description', link);
current.update();
})(current, previous);
Thanks
Kevin
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-26-2021 02:12 AM
Hi,
I am not sure on those 2 functions you are using from script include
but you can try this and check if it works and then debug the function
var url = '<a href="' + gs.getProperty('glide.servlet.uri') + '/nav_to.do?uri=' + current.getTableName() + '.do?sys_id=' + current.sys_id + '">' + current.getDisplayValue() + '</a>';
current.work_notes = '[code]' + url + '[/code]';
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-26-2021 02:47 AM
Got it working.
(function executeRule(current, previous /*null when async*/ ) {
var deepLinkGenerator = new global.MobileDeepLinkGenerator("agent");
var link = deepLinkGenerator.getFormScreenLink("472ceb7253b0330097a2ddeeff7b12f6", current.getTableName(), current.getValue("sys_id"));
var url = '<a href=' + link + '>Mobile Agent Link</a>';
current.work_notes = '[code]' + url + '[/code]';
//current.setValue('description', url);
current.update();
})(current, previous);
Thanks Ankur.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-26-2021 02:50 AM
Glad to know.
Just pasted something similar.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-25-2023 08:02 AM
Hi @Ankur Bawiskar sorry to barge in but I just wanted to know if it is possible to make the multi line text field values clickable to show a preview of the selected record ?
Here if I click a particular role it should show a preview of that record. How can I make it clickable? It's a multi line text field. I can change it to list collector or any other type to make it work but how can I achieve this? Pls help!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-25-2023 08:34 AM
I don't think so.
it's field messages where html tags are not supported.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-25-2023 09:00 AM
I can change the field type to list collector or something else but the user has to see the preview of the selected roles like as in reference field. Is it possible?
I need to show something like this for a field type that can accept multiple roles that are selected.