- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-09-2017 03:43 PM
Hello,
In the email notification, I want to attach a policy document.
I was wondering what was the reason behind not including attach document option straightforward in the email, instead I'm able to attach an image or video. (Image below)
Need your advise on the best practice:
1. Where should I upload this document in ServiceNow?
2. How can I just refer it to the email notification.
I have gone through some responses on attaching your incident attachments using some script. In my case, this is a independent document.
Appreciate your help.
Thanks,
Krishna
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-16-2017 09:38 PM
If you want to include some information from the parent record, we need to add a bit of scripting to the Notification. In the Workflow, you will want to add the sys_id of the Integrity record that is triggering the event into the "parm2" parameter (the last parameter in the following call to eventQueue):
gs.eventQueue("x_grs_compliance.investigation.policy", gr, "test@gmail.com", current.getValue("sys_id"));
Now that we are passing on the sys_id, we need to query the Integrity table to get the record and output the information we need. That will be done in 2 parts:
- add a call to a Notification Email Script into the body of the Notification
- create a new Notification Email Script
The script just searches for the Incident record and then uses template.print to output the required data from the Incident record.
I built the example above off the Incident table so you just need to change the table name and then add your fields for your purpose. That should do it for you. I ended up with an email like so:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-17-2017 01:09 PM
Thank you Jim. This worked great and I'm almost done.
One last challenge I have his to show the {URI_REF} for the current record in my email.
Can I write that in the email notification script?
My email below:
Here instead of KB0010059(referring to Knowledge table), I want to show my current concern record reference. Greatly appreciate your help.
Regards,
Krishna
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-17-2017 01:25 PM
You would have to use something like:
var link = gs.getProperty('glide.servlet.uri') + "nav_to.do?uri=" + gr.getLink();
template.print("Click <a href='" + link +"'>" + gr.getDisplayValue() + "</a> to view the concern.");
...in order to display a link.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-18-2017 05:14 PM
Jim,
You rock!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-16-2017 10:36 PM
Hi Krishna,
You can make use of "GlideSysAttachment.copy" function by simply writing a Business Rule on the required table with an operation as either Insert or update depending on your requirement with the below code as :
GlideSysAttachment.copy('Source Table', 'Sys Id of Attachment', 'Destination Table', current.sys_id);
Once the Business Rule has been configured, Navigate back to your existing Notification and just marked the Include attachment check box as True.
In my scenario, I was asked to send an PDF file along with Opened Notification for one of the Catalog Items, So I wrote an after Insert Business Rule On Requested Item table and my PDF file was attached to one of my Catalog item under Maintain Items module and in order to get the Sys Id of the Attachment, you need to navigate to sys_attachment.LIST table to get the sys id of the file attached to your record.
Hope this helps.Mark the answer as correct/helpful based on impact.
Regards,
Shloke
Regards,
Shloke
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-17-2017 01:13 PM
Hello Shloke,
I liked your idea, But, won't it be adding the same document everytime to a new record?
Instead of that, I expected ServiceNow should allow us to upload some documents to your application main table just for once and reuse them in any of our emails / subsequent applications.
Regards,
Krishna