function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Balázs RubicsekBalázs Rubicsek 

Process builder dual apex invoke problem

Hello
I have a process builder process which executes on a field update. After the first criteria evaluation I execute 3 actions

1.1 Invoke Email by Invocable Apex
1.2 Standard Field Update
1.3 Standard Email Alert

After the 1st criteria the process does not stop it evaluates the 2nd critera and it should execute 3 actions

2.1 Invoke Email by Invocable Apex
2.2 Standard Field Update
2.3 Standard Email Alert

User-added image

If I do the field update to meet criteria 1 but not criteria 2
all actions are executed which belong to the criteria (1.1,1.2,1.3)
Works fine!

If I do the filed update to meet criteria 2 but not criteria 1
all actions are executed which belong to the criteria (2.1,2.2,2.3)
Works fine!

If the field update meets criteria 1 AND 2 then the standard actions are executed (1.2,1.3,2.2,2.3) but ONLY ther first apex criteria is launched (1.1) and the second is completely ignored (2.1).

The apex action is only executed once which is wrong.

In the debug log there is NO apex exception.

And as the standard field updates/email alerts are executed it is sure that both criterias are met and considered by SF.

The problem is that the apex invoke is only launched once.
Has anyone had this problem before?
Please help.




 
Best Answer chosen by Balázs Rubicsek
James LoghryJames Loghry
Weird.  I'm not surpised this is happening, as processes in general have some odd bugs pop up time to time.  Have you tried copying the method into a new apex class, and trying to invoke each class/method once?

All Answers

James LoghryJames Loghry
Weird.  I'm not surpised this is happening, as processes in general have some odd bugs pop up time to time.  Have you tried copying the method into a new apex class, and trying to invoke each class/method once?
This was selected as the best answer
Balázs RubicsekBalázs Rubicsek
Hi James,
Good idea, I was thinking the same. I created a copy of the apex invocable class, with different name/method name/method display label and when I triggered the action, it fired both apex clases, so with this workaround I could make it work. This is another bug in process builder.
Thanks for the tip!