Ability to turn workflow/validation rules off when running tests - Ideas - Salesforce Trailblazer Community
Trailblazer Community

All Ideas

Idea Details

Post an Idea
2,490  Points
Open
Idea has been posted. Give it an upvote or downvote.

Ability to turn workflow/validation rules off when running tests

Process Automation

It would be very nice to have an option to turn off workflow/validation rules when running tests. Our code uses lots of status flags for custom logic which can be tweaked with workflow rules (so the enduser can customize the logic without having to see/touch the code). However, the unit tests that test for the default behavior fail if a workflow rule changes the default behavior. So having an option to turn them off temporarily just when running tests would help a lot ensuring that the code works as expected in the default configuration. Something like Test.DisableWorkflowRules() and Test.DisableValidationRules()

Merge Idea · Flag

Latest Comment from Salesforce

  • Andrew Waite - 10 years ago

    These elements are part of the logic in the application, don't tests need to validate the behavior with them in place? In other words, if your tests fail when an admin makes these changes doesn't that reflect a breakage your users will see?

    As an example if you have logic that creates duplicate records and an admin puts a validation rule in place that prevents duplicates isn't that a problem you want to prevent?
  • Upvotes
  • Downvotes

Ideas

Apps

from AppExchange

Questions

No results found.

Help us to keep IdeaExchange clean by pointing out overlapping ideas. We'll investigate your suggestion and merge the ideas if it makes sense.



 

 

Thanks for your merge suggestion. We will review it shortly and merge the ideas if applicable.

Salesforce takes abuse situations very seriously. Examples of abuse include but are not limited to posting of offensive language or fraudulent statements. To help us process your request as quickly as possible, please fill out the form below describing the situation. For privacy and security reasons, the final outcome of an abuse case may not be revealed to the person who reported it.


 

Thank you for your feedback. We take abuse seriously and will investigate this issue and take appropriate action.