Trigger an event from Approval Group activity on workflow

Magali Legaspi
Tera Contributor

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.

 

MagaliLegaspi_0-1679503002885.png

 

 

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!

8 REPLIES 8

@Magali Legaspi ,

 

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.

It's not working yet 😔

 

MagaliLegaspi_0-1679575055812.png

 

It won't trigger either the approval nor the email.

@Magali Legaspi ,

 

It should work!, 

 

1) Can you check in the event logs whether your event got triggered!

 

PRINCE_ARORA_1-1679576319543.png      

PRINCE_ARORA_3-1679576470445.png

 

 

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

PRINCE_ARORA_2-1679576406157.png

 

Virendra S
Tera Expert

@Magali Legaspi 

 

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