- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2017 04:17 PM
Hi everyone,
I've got an email script that adds the requested items associated with a parent request to an email as seen below. What I need is for each of those requested items to appear as a hyperlink to their record in SN. My email script is below.
here's my script...not sure what to add to it to get the hyperlinks going....thanks!
template.print("<p></p><strong>Requested item(s)</strong><br />");
var gr = new GlideRecord("sc_req_item");
gr.addQuery("request", current.sys_id);
gr.query();
while(gr.next()) {
template.print(gr.number + ": " + gr.cat_item.getDisplayValue() + "<br />");
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2017 05:06 PM
here you go..
template.print("<p></p><strong>Requested item(s)</strong><br />");
var baseURL = gs.getProperty('glide.servlet.uri');
var gr = new GlideRecord("sc_req_item");
gr.addQuery("request", current.sys_id);
gr.query();
while(gr.next()) {
template.print(gr.number + ": " + gr.cat_item.getDisplayValue() + "<br />"););
template.print("<a href=" + baseURL + gr.getLink() +">" + gr.number + "</a>");
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2017 05:23 PM
thanks guys!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2017 05:27 PM
ur welcome. yes, i did not test the code. i just had written something similar which i remembered could be used here. Glad to hear it worked.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2017 05:23 PM
You can use this:
==========================================================
template.print("<p></p><strong>Requested item(s)</strong><br />");
var gr = new GlideRecord("sc_req_item");
gr.addQuery("request", current.sys_id);
gr.query();
while(gr.next()) {
template.print("<a href='https://" + gs.getProperty('instance_name') + ".service-now.com/sc_req_item.do?sys_id=" + gr.sys_id + "'>" + gr.number + "</a>: " + gr.cat_item.getDisplayValue() + "<br />");
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2017 05:24 PM
this one worked perfectly, but thanks Samiul!
template.print("<p></p><strong>Requested item(s)</strong><br />");
var baseURL = gs.getProperty('glide.servlet.uri');
var gr = new GlideRecord("sc_req_item");
gr.addQuery("request", current.sys_id);
gr.query();
while(gr.next()) {
template.print("<a href=" + baseURL + gr.getLink() +">" + gr.number + "</a>");
template.print(": " + gr.cat_item.getDisplayValue() + "<br />");
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2017 09:17 AM
Hello Ajit,
on a separate topic I started a separate thread regarding automatically clearing the cart when a user opens an order guide...is this something you know about?