Trigger an event from Approval Group activity on workflow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2023 09:22 AM - edited 03-22-2023 09:36 AM
Hi all.
I need to trigger a notification once my workflow reaches one "Approval Group" activity. It's a custom notification because I have many other activities in same workflow which need other custom notifications as well.
I've been investigating, and I'm wondering; can I use in this script the gs.eventQueue function to trigger the custom approval notification? If so, how should I write the script? (I've never used gs.eventQueue before and I'm not sure how it works nor how I should write the script)
Thanks in advance!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2023 05:25 AM
The third parameter would be your/someone's email ID or user ID:
gs.eventQueue('approval.salesforce', current, gs.getUserID(), gs.getUserName());
Please try this code and let me know if this will trigger the notification!
And your notification will catch the third parameter of eventQueue(that mean first parameter for the user details).
If my answer solved your issue, please mark my answer as ✅ Correct & 👍Helpful based on the Impact.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2023 05:38 AM
It's not working yet 😔
It won't trigger either the approval nor the email.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2023 06:01 AM
It should work!,
1) Can you check in the event logs whether your event got triggered!
2) Can you check the email logs whether email has triggered? if Not? can you try to remove conditions from the notifications
Please remove and try
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2023 05:39 AM
Please validate is your Notification condition is matching the requirement and eventqueue is works as below..
eventQueue(name, Object glideRecord, String parm1, String parm2, String queue)
name - Name of the event being queued.
glideRecord - GlideRecord object, such as "current".
parm1 - (Optional) , such as current.number
parm2 - (Optional)
queue - Name of the queue