- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-08-2016 11:53 AM
I've created a new 'translated html' field on the Catalog Item form, similar to that of "Description", to add in some more information to my catalog items.
I'd like to use this additional information in the emails that send out when the catalog item's Request (sc_request table) is closed.
Can I dot walk to the properties of my Catalog Item? Can I pull the display value of my new 'translated html' field even? I tried doing a mail script to pull the data of my new "testinfo" field, but it comes back as undefined:
<mail_script>
var gr = new GlideRecord("sc_req_item");
gr.addQuery("request", current.sys_id);
gr.query();
while(gr.next()) {
template.print(gr.testinfo.getDisplayValue());
}
</mail_script>
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-13-2016 10:40 AM
Good day,
I was able to get this working after using the following code:
var gr = new GlideRecord("sc_req_item");
gr.addQuery("request", current.sys_id);
gr.query();
while(gr.next()) {
template.print(gr.cat_item.u_test_info.getDisplayValue());
}
This works as the email notification is running off of the Request table.
Thank you for everyone's time, especially Venkat who assisted me along with this day after day.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-11-2016 01:28 PM
I am indeed using Geneva.
When creating a new Notification Script, it auto gives me that leading and ending code. The only other option on screen is "Newlines to HTML" which is not selected.
This is exactly what I see: http://puu.sh/oeKxB/25777a6253.png
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-11-2016 01:51 PM
Great that helps. And how are you using the script within the tempate. Can you add a screenshot for that as well?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-11-2016 01:54 PM
Also Shane i noticed your add query is now having cat_item instead of request. I see in your first script you are running this notification out of request table. Can you modify the add query to have request with current.sys_id.
Regards,
Venkat
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-11-2016 01:57 PM
Among the message field, I have put in: ${mail_script:pull_catitem_u_test_info}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-11-2016 02:01 PM
Also Shane i noticed your add query is now having cat_item instead of request. I see in your first script you are running this notification out of request table. Can you modify the add query to have request with current.sys_id.