I am trying to bypass a validation rule on the Opportunity object from within a Flow. I have attempted this using the 'Toggle' technique as seen here: https://admin.salesforce.com/blog/2022/how-i-solved-this-use-a-toggle-and-flow-to-escape-validation-rules?_ga=2.24785081.2059426328.1666795622-1499501916.1666795622.
- I created a Toggle field on the Opportunity object.
- I added 'NOT(ISCHANGED(Toggle__c))' to the Validation Rule I am trying to bypass.
- In the Flow, I created a formula variable called “ChangeToggle” using an IF formula “IF(Toggle__c = TRUE, FALSE,TRUE)”
Here is a screenshot of the Flow:
All of the highlighted Nodes is where I have an assignment when I assign the 'Toggle' field to either True/ False in order to bypass the Validation Rule.
Here is an example for the Spring 2020 condition.
I then add this to a Collection Variable.
At the end of the Flow I update the Collection Variable.
From the debug logs it looks like the Toggle field is being updated:
But the Validation Rule is still being triggered: