- 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-08-2016 01:53 PM
That worked, it returned now with "Got 0 Records". Does this mean it isn't able to pull down the data from sc_cat_item?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-08-2016 02:01 PM
Hi Shane,
It should be able to access that value. Can you also add the following before the mail script to see if ${sys_id} is working as it is designed.
${sys_id}
also check for current.sys_id and ${current.sys_id} to see which one returns the sys id value. That should fix it all. I guess that is the root issue of the above problem.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-08-2016 02:10 PM
I added the following, and the output was the same sys_id all three times:
${sys_id}
${current.sys_id}
<mail_script>
template.print(current.sys_id);
</mail_script>
It shouldn't matter which I use then, no?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-08-2016 02:16 PM
It shouldnt then. The next i would try is this
gr.addQuery("sc_req_item.request" , "${sys_id}")
If you notice i added the table name before the column name. Once I faced a similar issue in an UI page and this fix got picked up.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-08-2016 02:38 PM
I am now returning 36827 records, on the "Got x records" line. I think I am stepping one level too high at this point?