0

I want to do something like

from simple_salesforce import Salesforce, format_soql

sf = Salesforce(username=..., password=..., security_token=..., domain=...)
result = sf.query(format_soql("SELECT Id, ValidationName, Active, Description, EntityDefinition.DeveloperName, ErrorDisplayField, ErrorMessage FROM ValidationRule"))

to fetch validation rules from Salesforce. The above obviously fails since I cannot query ValidationRules like Account or Contact records. How can I fix this?

1 Answer 1

2

You've got to use the Tooling API. Support for the Tooling API is relatively minimal in simple_salesforce, but it works just fine. Here, you would do

sf.toolingexecute("query?q=SELECT Id, ValidationName, Active, Description, EntityDefinition.DeveloperName, ErrorDisplayField, ErrorMessage FROM ValidationRule")

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .