0

I am facing a validation rule related issue on a field in Case object.

To find the exact problem, I need to search every validation rule for each field.

To do that I am trying to fetch the Case object through ANT so I can search on the local machine on fields' validation rules quickly.

To achieve the same I have modified my package.xml in below way:

<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">`
    <types>
        <members>*</members>
        <name>ApexClass</name>
    </types>
    <types>
        <members>*</members>
        <name>ApexPage</name>
    </types>
    <types>
        <members>*</members>
        <name>ApexTrigger</name>
    </types>
    <types>
        <members>Case</members>
        <members>*</members>
        <name>CustomObject</name>
    </types>
    <types>
        <members>*</members>
        <name>AuraDefinitionBundle</name>
    </types>
    <types>
        <members>*</members>
        <name>Flow</name>
    </types>
    <types>
        <members>*</members>
        <name>CustomTab</name>
    </types>
    <types>
        <members>*</members>
        <name>CustomApplication</name>
    </types>
    <types>
        <members>*</members>
        <name>RecordType</name>
    </types>
    <types>
        <members>*</members>
        <name>PermissionSet</name>
    </types>
    <types>
        <members>*</members>
        <name>ApprovalProcess</name>
    </types>
    <types>
        <members>*</members>
        <name>Layout</name>
    </types>
    <!--
    <types>
        <members>*</members>
        <name>Role</name>
    </types>
    -->
    <types> 
        <members>*</members>
        <name>Profile</name>
    </types>
    <types>
        <members>*</members>
        <name>GlobalValueSet</name>
    </types>
    <types>
        <members>*</members>
        <name>Workflow</name>
    </types>
    <version>47.0</version>
</Package>

As can be seen, I have added Case in CustomObject section.

But still, I am not able to get the Case object, though getting all custom objects.

What am I missing here?

3

Honestly, that should have worked. In your objects folder, you should have a Case.object, which contains the validation rules and everything else (fields, custom links, etc).

I would personally recommend using DX instead, which is arguably much more user friendly:

sfdx force:source:retrieve -m CustomObject:Case

You'll get each validation rule in its own file, located by default in force-app/main/default/objects/Case/validationRules/. Using VS Code should make it really easy to find the files you're looking for.

1
  • Thanks. I am able to find the Case.object in the objects folder. Earlier I was looking for a subfolder created as name Case as it is in case of custom objects. – वरुण Jan 3 '20 at 7:24
0

One way to do it would be to download the Force.com IDE, connect it to your Salesforce.com instance, and then set it to download all the validation rules. Then they'd all be listed there for you, and saved locally to boot, so you can just go through them one by one.

2
  • That IDE is already retired. Can't we do it via ANT? – वरुण Jan 3 '20 at 6:33
  • well in that case try VS Code or also you can try workbench to do the same. May be ANT is causing some issues while retrieveing your validation rules – Santosh Patro Jan 3 '20 at 6:46

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.