- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-08-2020 06:17 AM
I have Approval notification (sys_approval) table.
I want to add "Requested_for" in CC of notification.
I have gone through docs and could find email_script:
//email.addAddress(type, address, displayname);
email.addAddress("cc", "john.copy@example.com","John Roberts");
So I have tried to write something like below:
email.addAddress("cc",current.getValue('requested_for'),current.getValue('name'));
But I am here confused like table is sys_approval and we are expecting Requested_for on CC field.
So Can anyone help me out with this requirement.
Appreciate any quick help!!
Thanks,
Anupam.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-09-2020 05:29 AM
You will need to add that code to mail script that is included in the Approval notification mail body.
Ensure your mail script checks that current.tableName() == 'sc_request' before adding the email.address() line to avoid errors. These docs should help you get started and provide some examples of email scripting.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-08-2020 06:21 AM
Is current.requested_for an email? The second parameter needs to be an email. Try something like:
email.addAddress("cc", current.requested_for.email, current.name);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-08-2020 06:21 AM
You noted the sys_approval table - that's not a standard OOB table. Did you mean sysapproval_approver?
Most approvals are generic to any record so assuming there is a way to dot-walk to requested_for is asking for trouble since requested_for is only available on sc_request. Do you have logic somewhere to say "is the approval for an sc_request or sc_req_item record?) Otherwise if a change_request approval comes up, your script is going to have issues.
Let me know what you find and the correct table name where you are working on this stuff. Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-08-2020 09:59 AM
Hi Chuck,
The correct table is "sysapproval_approver".
so we want that Approval notification should be trigger to Requested_for also.
And Requested_for should be in CC.
Could you please tell how can we achieve that?
As I could see below code for it:
email.addAddress("cc", "john.copy@example.com","John Roberts");
So how we can achieve here?
Appreciate your help!
Thanks,
Anupam.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-09-2020 05:29 AM
You will need to add that code to mail script that is included in the Approval notification mail body.
Ensure your mail script checks that current.tableName() == 'sc_request' before adding the email.address() line to avoid errors. These docs should help you get started and provide some examples of email scripting.