How to query all Validation Rules with object names in Salesforce?

Sample SOQL:

SELECT ValidationName, Active, EntityDefinition.DeveloperName FROM ValidationRule

When you use Developer Console, use Tooling API to query.

For more fields, check the below link


  1. 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

    1. Use Developer Console and query it. Press CTRL + A and copy the contents. Paste it in a excel file.

  2. Hi Magulan,
    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 :)

    1. ErrorConditionFormula is not supported.
      Also remove EntityDefinition.DeveloperName.

  3. 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

    or a way to goto the URL.. 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:)

    1. You can try composite request if you have series of callouts.
      Check this for example -