- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-17-2017 11:13 PM
Hello Everyone,
i want to populate Requested By name under Email template, Requested For (u_req_for) is from RITM table which should be populated on Template i tried Select Variables which is present in the Template but i unable to find the Requested For name since the email template is written on Approval table.
Can anyone please help me out how to populate the RITM table field on Approval table ?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-18-2017 04:09 AM
Rajesh feedbacks were helpful but you will still need to query the req_item table;
Please try this just for the fun somewhere on your code
<mail_script>
var ritm = new GlideRecord('sc_req_item');
if(ritm.get(current.sysapproval)){
var req_for = ritm.u_req_for.name;
template.print("Requested for :"+ritm.request.requested_for.name);
template.print("Requested by :"+ritm.u_req_for.name);
}
</mail_script>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-17-2017 11:27 PM
You have to configure a mail script to query the requested item table. Not much of a choise
Then use the template.print function to print it
<mail_script>
var ritm = new GlideRecord('sc_req_item');
if(ritm.get(current.sysapproval)){
var req_for = ritm.u_req_for.name;
template.print("Requested for :"+req_for);
}
</mail_script>
Of course you don't need this trick for fields that are on the task table.
These can be accessed directly like for example the opened by ${sysapproval.opened_by}
I didn't test this code but I'm 100% certain that it will work
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-18-2017 12:41 AM
Younes,
there is already a mail script running for this template but i am not very sure where to add as i am new to scripting i an totally blank
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-17-2017 11:28 PM
Hi Irfan,
just add below line in HTML Message :
Request Requested for: ${request.requested_for}
Thanks,
Rajashekhar Mushke
Rising star : 2022 - 2024
Community Leader -2018
Connect me on LinkedIn : Rajashekhar Mushke
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-17-2017 11:31 PM
Yes this will work if Shaik wants to use the sc_request requested for.