0

I'm having more issues that I'd expect trying to add a validation rule to contacts. The issue is that I'm experiencing workflow creep.

I rely on process builder and flows to keep certain objects in sync. Let me give you an example, say I have a contact with two flags: mailing and shipping. Let's also say I have another object called contact role, which also has flags for billing and shipping. I have workflows that keep these flags in sych, so if mailing is checked/unchecked on one record, it will run a flow to update the related record (contact to contact role and vice versa). Now enter the validation role. I've added a validation role that will trigger when the contact status is "inactive" and either one of these checkboxes are checked.

The issue I seem to be having is that if I am to uncheck both of these on a contact and set status to inactive, the validation rule causes a workflow error because the updates to the flags and updating of the related records is not done at once; there are two separate flows. So the first thing to occur is that the mailing checkbox is unchecked, and its related record is unchecked. Then I get the workflow error, due to I'm assuming the record saving with the mailing checkbox still checked on the record.

My assumption would be that the validation rule would not fire until ALL workflows have finished. Is this not the case? I also question whether the recursion setting on the workflows could be the culprit here. Obviously if ALL workflows finish before the validation runs, it should pass as both checkboxes should be unchecked in the final state.

1
  • Validation rules are processed well before any workflow rules are processed. The order of processing precedence is documented is this Knowledge Article and the Apex Developer Guide Commented Jul 24, 2016 at 11:12

1 Answer 1

0

Validation rules are processed well before any workflow rules are processed. The order of processing precedence is documented is this Knowledge Article and the Apex Developer Guide

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.