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.