- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-17-2020 04:12 AM
Hello Community,
Can any one help below requirement.
I want to display the number in notification body through email script and if i click that number it should be open form view same record and i dont want to open in service portal.
anyone help me with the script it's highly appreciated.
Thanks,
Ramesh kalava
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-18-2020 05:22 AM
Hi
In your script you can do simply like this
var attachLink = '<a href="/incident.do?sys_id='+current.sys_id+'">' + current.number + '</a>'; //put your table name
template.print(attachLink);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-17-2020 07:08 AM
Hi,
the script should work; please try adding logs and check where it is breaking
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
‎08-17-2020 04:24 AM
Hey kalava,
Refer the link, it will help you:
Mark it Correct or Helpful, if it works based on impact....!!!!
Best Regards,
Namrata.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-17-2020 05:51 AM
You can try the below code:
(function runMailScript(/* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */ email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */ event) {
var link = new GlideSubstituteURL().generateURL(current, '');
var anchor = "<a href='" + link +"'>" + current.number + "</a>";
})(current, template, email, email_action, event);
Palani

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-18-2020 05:22 AM
Hi
In your script you can do simply like this
var attachLink = '<a href="/incident.do?sys_id='+current.sys_id+'">' + current.number + '</a>'; //put your table name
template.print(attachLink);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-18-2020 05:50 AM
Hi Asif,
I have tried the above script and it's working perfectly.
Thanks for the solution.
Thanks,
Ramesh Kalava