SELECT ValidationName, Active, EntityDefinition.DeveloperName FROM ValidationRule
When you use Developer Console, use Tooling API to query.
For more fields, check the below link
6 thoughts on “How to query all Validation Rules with object names in Salesforce?”
Hi, How do we query all validation rules for all objects in an org, the objective is to extract all the validation rules for all the objects(standard and custom) to excel
Use Developer Console and query it. Press CTRL + A and copy the contents. Paste it in a excel file.
Thanks for your response, I have used below query in REST Explorer
When I am using the above query in REST Explorer, I am getting below INVALID_FIELD message: EntityDefinition.DeveloperName,ErrorConditionFormula, ErrorMessage ^ ERROR at Row:1:Column:61 No such column 'ErrorConditionFormula' on entity 'ValidationRule'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names. errorCode: INVALID_FIELD
I am still bit new to SF world 🙂
ErrorConditionFormula is not supported.
Also remove EntityDefinition.DeveloperName.
thanks..I thought so 'Query this field only if the query result contains no more than one record. Otherwise, an error is returned. If more than one record exists, use multiple queries to retrieve the records. This limit protects performance.' But is there a way where I can retrieve callout bulk HTTP Get Requests if I have the Validation record Ids..eg:
or a way to goto the URL..https://xxxxxxxx.my.salesforce.com/xxxxxxxxxxxxwVQAS for each record and grab the fields and its Values.
Somehow your replies are not coming to my email :), I had to visit the page to check for your response:)
You can try composite request if you have series of callouts.
Check this for example – https://www.infallibletechie.com/2020/06/fetching-validation-rule-from-tooling.html