What condition your validation is in

Standard

Validation rules and Decaf coffee are both things that can really mess up a morning.

what a crazy validation rule

one day, this will happen

Suppose you had a flow, and you were running said flow on an object that happened to have a validation rule right smack in the middle of the flow superhighway

The typical course of action is to write yet another exception to that validation rule based on profile, role, user, time of the day, etc..

Breaking the Rules

Breaking the Rules

The problem though is that if you create an exception to the validation to let your flow run, you have to let that exception go through the UI as well. Kind of like if your windows could only be opened all the way or closed tight…

Argh, if only there was a way around this…oh wait, the reason I am posting this is exactly because I do have a work around!

 

I prefer to think of it as Agile

I prefer to think of it as being Agile

We are going to do couple of tweeks to the flow and to the user record.

1) Add a new checkbox on the user record called “Ultra Awesome Validation Bypass”…or something like that.

Yeah totally just did that

Totally just happened

 

On the flow, we are going to add a couple things before the main updates…

1) Add a new element to the visual flow that does a look up on the user record

2) Add a new element to the visual flow that updates the field “Ultra Awesome Validation Bypass” to “TRUE”

3) Add a new element to the visual flow that updates the field “Ultra Awesome Validation Bypass” to “FALSE”

After

Start to Finish

 

Last Step (Pinky Promise!) is that we add in an exception to the workflow that if the “Ultra Awesome Validation Bypass” field for the running user is TRUE then the update is ignored.

We don't need your rules!

We don’t need your rules!

 

So, there ya have it. Now, like everything else, this is just meant to be a foundation for more and better and awesomer things. I personally really like this idea because it gives a flexible and situation driven method to bypassing validation rules.

Any questions or Comments? Send them on over! I love to hear from you all!

 

Advertisement