Validation rules and Decaf coffee are both things that can really mess up a morning.
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..
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!
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.
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”
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.
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!
10 thoughts on “What condition your validation is in”
This works great if an Admin is running the flow because you have edit permissions on the user record. Doesn’t help for the use case where a non-admin user is running the flow and needs super Validation bypass powers because they can’t edit their user record.
Thanks for adding your comment! I love hearing from my readers!
Since I used a custom field on the user object, I can determine who can modify this field. As long as I have it enabled for a particular users profile, it should work just fine. I ran some tests with non admin users in my “skunk works” org and I ran into no issues.
If you are seeing different results, drop me a line on the success community!
Cool and thanks for the article.
Brilliant idea! I already have a field on the user object where we set bypasses for specific validation rules, but I had never thought of turning it on & off in a flow. Excellent!
Thanks for visiting my blog and the compliment!
Hey ! Just wondered what lookup criteria you are passing in to the getUser element of the flow to pickup the current user? thanks!
New post coming in which I explain exactly how I would do this!
This is great Andrew! I want to give it a try but what are we looking up on the User record? How do you look at the “running user”?
I didn’t include that in my post, so I am going to release a new post tonight with my favorite way of pushing data to (And launching) flows!