Joey Chan

Do you need to get a list of all Validation Rules in Salesforce for documentation or cleanup work?

Important notes:

  • Use the Tooling API when using the Developer Console to do the query
SELECT Id, ValidationName, Description, EntityDefinition.DeveloperName, ErrorDisplayField, ErrorMessage 
FROM ValidationRule

If you need to get the error condition, you need to make sure there is only one result by providing the ID of the validation rule from the query above:

SELECT Id, ValidationName, Metadata, Description, EntityDefinition.DeveloperName, ErrorDisplayField, ErrorMessage 
FROM ValidationRule
WHERE Id = ‘PUT_VALIDATION_RULE_ID_HERE’

Resources:

https://developer.salesforce.com/docs/atlas.en-us.api_tooling.meta/api_tooling/tooling_api_objects_validationrule.htm

--

--

Joey Chan

Joey Chan

#1 Dev in AppExchange | Founder/Salesforce Technical Architect Cloud Jedi Solutions