2

We utilise email-to-case, I have a process builder flow executing on new cases that, amongst other elements, closes cases received from specific emails automatically. The conditions for this are, the logic is (1 OR 2 OR 3 OR 4) AND 5 AND 6

  • SuppliedEmail = X4@X.com
  • SuppliedEmail = X3@X.com
  • SuppliedEmail = X2@X.com
  • SuppliedEmail = X1@X.com
  • Record Type = 'Blah'
  • Status does not equal 'Closed'

I also have a Workflow rule, which judging by the Salesforce order of execution is executed next. This rule runs against the Email message object and reopens closed cases with logic 1 AND 2 AND (3 OR 4 OR 5 OR 6):

  • Email Messainge: Is Incoming equals True
  • Case: Closed equals True
  • Email Message: From Address not equal to X4@X.com
  • Email Message: From Address not equal to X3@X.com
  • Email Message: From Address not equal to X2@X.com
  • Email Message: From Address not equal to X1@X.com

I expected the workflow rule NOT to fire on emails received from the same from address as the SuppliedEmail on the case.

Unfortunately when a record comes in, the process runs first and correctly executes the actions but so does the workflow, the email address are correct. You can see the case history here, the bottom three actions are the process builder flow and the next two are the workflow rule. Can you advise what is wrong with my workflow logic?

Case History

Thanks

  • so the process builder - closes the cases and Workflow rule - Reopens the closed cases. Right? If yes, according to your case history, the workflow seems to be executed first... If I am wrong, please share the entire case history. – Saumya Gaikwad Aug 30 '18 at 11:09
  • Hi, logically it should (I assume email to case creates the email message record before the case record) but the case history shows the process builder running first - it closes the cases - the workflow rule is designed to re-open cases when a new email comes in. Sorry I didn't talk about actions enough above. – sfdc_beginner1 Aug 30 '18 at 11:48
5

According to Order of Execution, workflow rule will be evaluated first and since in the criteria Case: Closed equals True, so workflow rule will not meet the criteria.

So, process builder will come next and it meets the criteria Status does not equal 'Closed' and it is executed first.

After this execution, system has updated the status and workflow rule is getting evaluated again and that time it matches with Case: Closed equals True and hence workflow works.

Hope it clarifies your doubt.

Order is like this at this scenario

  1. Workflow tries to execute and not matching the rule criteria
  2. Process builder executing as matching the criteria.
  3. Workflow is executing again since record got updated.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.