0

I have got a User Story to delete all the Inactive Validation rules in Salesforce.

Instead of doing it manually I am finding another way(through Apex Code) to do it.

  • Metadata API can help you achieve that. – Sam Apr 22 at 7:06
2

You can get the validation rule by making REST request using below query -

/services/data/v43.0/tooling/query?q=Select+Id,Active,Description,EntityDefinition.DeveloperName,+ErrorMessage+From+ValidationRule+where+EntityDefinition.DeveloperName+=+'Account'

And then you can delete it using metadata api.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.