- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2019 11:26 AM
in the email notification , we have an email script that returns undefined , any ideas please?
template.print("vendor: "+ current.variables.vendor_name + " submitted by : "+current.variables.requestor.getDisplayValue() +" was added to the vendor list .");
and this is the notifications:
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2019 12:49 PM
Hi Sonita,
I'm not entirely sure what changed between your upgrade but you should be able to get the variables through the GlideRecord. Try the following in your email script:
var ritm = new GlideRecord("sc_req_item");
//I assume the email notification is being run on the sc_req_item table
if (ritm.get(current.sys_id)) {
template.print(gs.getMessage("vendor: {0} submitted by : {1} was added to the vendor list .",[ritm.variables.vendor_name,ritm.variables.requestor.getDisplayValue()]));
}
I haven't been able to test this but let me know if it worked for you.
Brent
P.S. If my suggestion helped then please mark as helpful and/or correct so other community members can benefit from this information.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2019 11:40 AM
Sonita,
Can you check the variable names and complete code where you are querying the record information? Try to debug your code using background script.
~Raghu.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2019 12:03 PM
Hi Sonita,
Can you please advise which table the notification is being generated from i.e. sc_request or sc_req_item.
Brent
P.S. If my suggestion helped then please mark as helpful and/or correct so other community members can benefit from this information.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2019 12:11 PM
actually it happened after upgrade; it was working fine in previous release
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2019 12:49 PM
Hi Sonita,
I'm not entirely sure what changed between your upgrade but you should be able to get the variables through the GlideRecord. Try the following in your email script:
var ritm = new GlideRecord("sc_req_item");
//I assume the email notification is being run on the sc_req_item table
if (ritm.get(current.sys_id)) {
template.print(gs.getMessage("vendor: {0} submitted by : {1} was added to the vendor list .",[ritm.variables.vendor_name,ritm.variables.requestor.getDisplayValue()]));
}
I haven't been able to test this but let me know if it worked for you.
Brent
P.S. If my suggestion helped then please mark as helpful and/or correct so other community members can benefit from this information.