- 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:05 AM
I tried using your code:
(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="' + gs.getProperty('glide.servlet.uri') + deepLinkGenerator.getFormScreenLink("472ceb7253b0330097a2ddeeff7b12f6", current.getTableName(), current.getValue("sys_id")) + '</a>';
current.work_notes = '[code]' + url + '[/code]';
//current.setValue('description', link);
current.update();
})(current, previous);
I must be doing something wrong.
It didn't work.
- 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:31 AM
Hi,
This is working fine, but when I call the script include within it. It's not 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="' + gs.getProperty('glide.servlet.uri') + deepLinkGenerator.getFormScreenLink("472ceb7253b0330097a2ddeeff7b12f6", current.getTableName(), current.getValue("sys_id")) + '</a>';
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]';
//current.work_notes = '[code]' + url + '[/code]';
//current.setValue('description', link);
current.update();
})(current, previous);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-26-2021 02:35 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-26-2021 02:49 AM
Update as this
(function executeRule(current, previous /*null when async*/ ) {
var url = '<a href="' + new global.MobileDeepLinkGenerator("agent").getFormScreenLink("472ceb7253b0330097a2ddeeff7b12f6", current.getTableName(), current.getValue("sys_id")) + '</a>';
current.work_notes = '[code]' + url + '[/code]';
current.update();
})(current, previous);
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader