+ Start a Discussion
Danielle SDanielle S 

by pass validation rules in flows

Hi all, 
I have a flow that update a custom field called Comment. from the Account record page , a user select multiple opportunities and update this fields.
The problem, is when Close date is in the past , the flow is producing an error because of the validation rule that we have for close date ( must be in the present or in the future). 
Could you please advice on a solution to prevent this error to occur ? 
thank you 
VinayVinay (Salesforce Developers) 
Hi Danielle,

Check below examples to by pass validation rules in flows.


Also kindly review below limitation.

Please mark as Best Answer if above information was helpful.

Danielle SDanielle S
Hi @Vinay
I tried both solutions provided in the articles you shared but for some reason , it does not work.
The first problem is that the validation rule does not fire when we update opportunities with close date in the past. 
Indeed, when I update the flow using the flow , I am getting an error. 
 for the solution with the Toggle : I have a doubt about hte fomulat. I followed what they did in the article and I selected my Get opportunities variable and I added .Toggle__c , but I got this error :  The element has an invalid reference to "Get_opportunities.Toggle__c". 

User-added image
Then I tried to this formulat : IF(Toggle__c}= TRUE, FALSE,TRUE) , then I got The formula expression is invalid: Syntax error
I finally used : IF({!recordId.Toggle__c}= TRUE, FALSE,TRUE) , the syntax is correct but the flow is not working .
User-added imageUser-added image
Below is the Ge Record element I used in the flow 
User-added image
I appretiate your help and advice, 
thnak you !