3

I have a process builder that sends newly created leads to an account queue to be round robin'd by some apex code executed in a before trigger if the new lead meets certain criteria. I then am wanting an email alert to go out to the newly assigned lead owner after the round robin.

I am using workflow rules to send the email alert with the following formula:

And( 
Contains(Owner:User.UserRole.Name ,'MyRole'), 
DATEVALUE(CreatedDate) = Today(), 
LastModifiedById <> Owner:User.Id, 
ISBLANK(LastActivityDate) 
)

I have the evaluation criteria set to Evaluate the rule when a record is created, and every time it's edited. However, from what I can see in the debug logs, this workflow rule is only ran before the lead gets sent through the Round Robin process, so the owner ID in this case is the database, which causes the criteria to evaluate to false. I'm pretty stumped as to why this isn't evaluating when the lead owner changes after the round robin.

1 Answer 1

3

I believe something with the order of execution was causing this, so I ended up putting this logic in an Apex trigger that runs after update as workflows do not give me the control necessary to do this that I know of.

1
  • Hey Josh, I'm just now encountering the same exact instance in April 2019, and I can tell you that my formula is much less elaborate than yours. I think I've boiled it down to Owner:User.Id not showing the User Id, it always evals to null for me. Even though the debug log recognizes that my ISCHANGED(OwnerId) evals to a User Id, the Owner:User.Id val continues to throw null, so criteria always fails. My solution for now seems to be writing the logic in my trigger also. I think this is a bug to be honest, seems wrong. Commented Apr 2, 2019 at 1:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .