How do I trigger an event for sysapproval_approver table from an approval activity in a workflow?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2022 11:05 AM
Hi - I need some direction on how to set up a custom approval email from a workflow for one specific workflow. I've searched the community, but I haven't found a solution that helps me.
Scenario:
I have a specific workflow where I need to send a custom approval email to approvers that will allow them to approve/reject the RITM from the email.
From my search on the community, it appears I need to do the following:
1. Create an event in the Event Registry on the Approval (sysapproval_approver) table, which is used to trigger the email.
2. Create a custom email Notification (on the approval table) that is triggered when the event is fired.
3. Call the event from the Approval - User activity in the workflow. This is where I'm stuck.
4. Create an Inbound email action to handle the approval email response (although it appears the OOB inbound action will work).
How can I call an event from the Approval - User activity that will run on the Approval table and not the Requested Item table? From what I've read, using gs.eventQueue() doesn't trigger the event correctly since it gets triggered on sc_req_item and not sysapproval_approver - which is the table I need.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2022 11:42 AM
Hi, not sure if I have understood your question correctly, but I would expect the best OOB\minimal customization would be a standard approval activity in the workflow, then the only changes that then need to be made are
- A new custom approval notification
- An update to the OOB approval notification so that it is not triggered when the custom approval notification is triggered - this might be based on the tasks company, assignment group, requester, categories etc.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2022 08:04 PM
Hi gjz.
Frist, You can click "Advanced view" to check "Event parm 1 contains recipient".
Then you can use this code to call event and pass email or sys_id of group. You can follow:
//Send email to group
gs.eventQueue('name_event', '' , '' , 'sys_id of group'); //sys_id of group
//Send email to someone
gs.eventQueue('name_event', '' , '' , 'email_address');
OR
gs.eventQueue('name_event', '' , '' , 'sys_id of user');
//If you want to send email to user who is queried
// You can query. Then you use sys_id of this user and use [gs.eventQueue('name_event', '' , '' , 'sys_id of user');]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2023 01:35 PM
Hello Tran.
I'm having the same issue - I have an "Approval - Group" activity on my workflow and I need it to trigger a custom notification. I tried this:
gs.eventQueue('approval.salesforce', '' , '' , 'BU United States');
On the Advanced checkbox of the approval activity, but it's not working.
approval.salesforce is the name of the event I created.
BU United States is the group. (I've tried with the sys id as well and it didn't work either).
I've checked the Event parm 1 contains recipient on the email notification.
Nothing's working to trigger the notification I've created. The workflow is running on req_item table. Email notification is on sysapproval_approver.
Please please help.
Thanks in advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2024 05:57 PM - edited 11-20-2024 05:58 PM
I'm having this exact same issue using a flow. Hoping someone has reached a solution.