Solution: Using tooling api ,the validation rules can be queried.
Example: Use the following query in developer console by enabling the tooling api
SELECT Id, Active, Description, EntityDefinition.QualifiedApiName, ErrorDisplayField, ErrorMessage,ValidationName FROM ValidationRule
Output:
To filter validation rules for a specific object, use EntityDefinition.QualifiedApiName(object api name) in where clause of query
Example:
SELECT Id, Active, Description, EntityDefinition.QualifiedApiName, ErrorDisplayField, ErrorMessage,ValidationName FROM ValidationRule where EntityDefinition.QualifiedAPiName='A__c'
Output:
No comments:
Post a Comment