- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2021 07:03 PM
Hello ,
I have a mail script for customer service(sn_customerservice_case). I want to include a link to the record "backend" whenever a customer is attaching a document on the service portal ticket.
i have lots of questions on ${URI} and ${URI_REF} with LINK word to it.I am not sure how to implement it.My code is very generic and i am not sure how to modify this to get the correct record in the backend.Please help me in fixing this error.
var gr = new GlideRecord("sys_attachment");
gr.addQuery('table_name', 'sn_customerservice_case');
gr.query();
while (gr.next()) {
template.print('Attachment: <a href="https//' + gs.getProperty("glide.servlet.uri") + '/sys_attachment.do?sys_id=' + gr.sys_id + '">' + gr.file_name + '</a>');
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2021 04:24 PM
Hi, it would have been helpful if you had earlier provided clear details regarding any customization that was preventing OOB functionality from working .
What exactly does 'they have hard-coded servicenow instance' mean?
Creating a URL for direct access to an instance record via mail script would look something like
var instanceURL = gs.getProperty('glide.servlet.uri');
var myTable = current.sys_class_name;
var myURL = '<a href=' + instanceURL + '/nav_to.do?uri=' + myTable + '.do?sys_id=' + current.sys_id + '>' + current.number'</a>';
template.print(myURL);
if you are unsure of URL format on any form record header,
you can right click and select 'Copy URL' from the menu.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2021 04:24 PM
Hi, it would have been helpful if you had earlier provided clear details regarding any customization that was preventing OOB functionality from working .
What exactly does 'they have hard-coded servicenow instance' mean?
Creating a URL for direct access to an instance record via mail script would look something like
var instanceURL = gs.getProperty('glide.servlet.uri');
var myTable = current.sys_class_name;
var myURL = '<a href=' + instanceURL + '/nav_to.do?uri=' + myTable + '.do?sys_id=' + current.sys_id + '>' + current.number'</a>';
template.print(myURL);
if you are unsure of URL format on any form record header,
you can right click and select 'Copy URL' from the menu.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2021 08:34 PM
${URI} and ${URI_REF} provide the link and Case#. However, when a user clicks , it is directing them to different page which is not accessible at all. When i asked my architect, told me that they "hardcoded this and have to be corrected in a different environment". I asked further details but I didn't get any response. Thanks for your reply. I will move on from the mail script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2021 07:33 PM
Approvers need to see the attachment in the case record whenever the attachment is added.