3

I don't see a similar Question here or via Google searches.

Is there a way (I would presume it would be outside the SF GUI) to search "everything" in SF? That would translate into all object field names and labels, validation rule and formula texts, etc?

I dare even say (hope), email templates created by users?

I am hopeful that to an extreme such as using Eclipse or some other tool, you could do this.

Example: Old validation rules written by someone who used the "Name" of a profile to lock things out, instead of an ID or something else? Searching for "Automation Access" (text of the Profile name that would show up in such a Validation rule).

Of course, searching for Email Templates by body text or even subject would be wonderous as well, but that's not "as important" as the need explained above.

Thanks for any insights.

3

Have you used Eclipse or the Force.com Migration Tool before?

To search data, you have SOSL and the global search widget. To search configuration, you can pull everything down with Eclipse or the Force.com Migration Tool. I try to stay as toolchain agnostic as possible.

This ant script will dump all validation rules, email templates, custom objects etc into a directory called 'dump' which you can then search through.

<target name="dump" description="Dumps out most customizations and components from an organization">
    <!-- Clean up any previous dump -->
    <delete dir="dump" />
    <mkdir dir="dump" />

    <!-- Prepare a wildcard package definition with as many metadata types as possible -->
    <echo file="dump/package.xml"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
        <Package xmlns="http://soap.sforce.com/2006/04/metadata">
            <types><members>*</members><name>AccountCriteriaBasedSharingRule</name></types>
            <types><members>*</members><name>AccountOwnerSharingRule</name></types>
            <types><members>*</members><name>AccountSharingRules</name></types>
            <types><members>*</members><name>AnalyticSnapshot</name></types>
            <types><members>*</members><name>ApexClass</name></types>
            <types><members>*</members><name>ApexComponent</name></types>
            <types><members>*</members><name>ApexPage</name></types>
            <types><members>*</members><name>ApexTrigger</name></types>
            <types><members>*</members><name>ApexTriggerCoupling</name></types>
            <types><members>*</members><name>AuthProvider</name></types>
            <types><members>*</members><name>BusinessProcess</name></types>
            <types><members>*</members><name>CallCenter</name></types>
            <types><members>*</members><name>CampaignCriteriaBasedSharingRule</name></types>
            <types><members>*</members><name>CampaignOwnerSharingRule</name></types>
            <types><members>*</members><name>CampaignSharingRules</name></types>
            <types><members>*</members><name>CaseCriteriaBasedSharingRule</name></types>
            <types><members>*</members><name>CaseOwnerSharingRule</name></types>
            <types><members>*</members><name>CaseSharingRules</name></types>
            <types><members>*</members><name>CompactLayout</name></types>
            <types><members>*</members><name>ConnectedApp</name></types>
            <types><members>*</members><name>ContactCriteriaBasedSharingRule</name></types>
            <types><members>*</members><name>ContactOwnerSharingRule</name></types>
            <types><members>*</members><name>ContactSharingRules</name></types>
            <types><members>*</members><name>CustomApplication</name></types>
            <types><members>*</members><name>CustomApplicationComponent</name></types>
            <types><members>*</members><name>CustomField</name></types>
            <types><members>*</members><name>CustomLabel</name></types>
            <types><members>*</members><name>CustomLabels</name></types>
            <types><members>*</members><name>CustomObject</name></types>
            <types><members>*</members><name>CustomObjectCriteriaBasedSharingRule</name></types>
            <types><members>*</members><name>CustomObjectOwnerSharingRule</name></types>
            <types><members>*</members><name>CustomObjectSharingRules</name></types>
            <types><members>*</members><name>CustomObjectTranslation</name></types>
            <types><members>*</members><name>CustomPageWebLink</name></types>
            <types><members>*</members><name>CustomTab</name></types>
            <types><members>*</members><name>Dashboard</name></types>
            <types><members>*</members><name>DataCategoryGroup</name></types>
            <types><members>*</members><name>Document</name></types>
            <types><members>*</members><name>EmailTemplate</name></types>
            <types><members>*</members><name>FieldSet</name></types>
            <types><members>*</members><name>FlexiPage</name></types>
            <types><members>*</members><name>Flow</name></types>
            <types><members>*</members><name>Group</name></types>
            <types><members>*</members><name>LeadCriteriaBasedSharingRule</name></types>
            <types><members>*</members><name>LeadOwnerSharingRule</name></types>
            <types><members>*</members><name>LeadSharingRules</name></types>
            <types><members>*</members><name>Letterhead</name></types>
            <types><members>*</members><name>ListView</name></types>
            <types><members>*</members><name>NamedFilter</name></types>
            <types><members>*</members><name>OpportunityCriteriaBasedSharingRule</name></types>
            <types><members>*</members><name>OpportunityOwnerSharingRule</name></types>
            <types><members>*</members><name>OpportunitySharingRules</name></types>
            <types><members>*</members><name>RecordType</name></types>
            <types><members>*</members><name>RemoteSiteSetting</name></types>
            <types><members>*</members><name>Report</name></types>
            <types><members>*</members><name>ReportType</name></types>
            <types><members>*</members><name>SamlSsoConfig</name></types>
            <types><members>*</members><name>Scontrol</name></types>
            <types><members>*</members><name>SharingReason</name></types>
            <types><members>*</members><name>StaticResource</name></types>
            <types><members>*</members><name>ValidationRule</name></types>
            <types><members>*</members><name>WebLink</name></types>
            <types><members>*</members><name>Workflow</name></types>
            <types><members>*</members><name>WorkflowAlert</name></types>
            <types><members>*</members><name>WorkflowApex</name></types>
            <types><members>*</members><name>WorkflowChatterPost</name></types>
            <types><members>*</members><name>WorkflowFieldUpdate</name></types>
            <types><members>*</members><name>WorkflowKnowledgePublish</name></types>
            <types><members>*</members><name>WorkflowOutboundMessage</name></types>
            <types><members>*</members><name>WorkflowQuickCreate</name></types>
            <types><members>*</members><name>WorkflowRule</name></types>
            <types><members>*</members><name>WorkflowSend</name></types>
            <types><members>*</members><name>WorkflowTask</name></types>
            <version>29.0</version>
        </Package>
    ]]></echo>

    <!--
     ! These metadata types are either unpackageable, or tricky because
     ! they are coupled to profiles (app) or users (permissionsets):
     ! <types><members>*</members><name>ApprovalProcess</name></types>
     ! <types><members>*</members><name>AssignmentRule</name></types>
     ! <types><members>*</members><name>AssignmentRules</name></types>
     ! <types><members>*</members><name>AutoResponseRule</name></types>
     ! <types><members>*</members><name>AutoResponseRules</name></types>
     ! <types><members>*</members><name>Community</name></types>
     ! <types><members>*</members><name>CustomSite</name></types>
     ! <types><members>*</members><name>EscalationRule</name></types>
     ! <types><members>*</members><name>EscalationRules</name></types>
     ! <types><members>*</members><name>HomePageComponent</name></types>
     ! <types><members>*</members><name>HomePageLayout</name></types>
     ! <types><members>*</members><name>InstalledPackage</name></types>
     ! <types><members>*</members><name>Layout</name></types>
     ! <types><members>*</members><name>PermissionSet</name></types>
     ! <types><members>*</members><name>Profile</name></types>
     ! <types><members>*</members><name>Queue</name></types>
     ! <types><members>*</members><name>QuickAction</name></types>
     ! <types><members>*</members><name>Role</name></types>
     ! <types><members>*</members><name>Settings</name></types>
     ! <types><members>*</members><name>SynonymDictionary</name></types>
     ! <types><members>*</members><name>WorkflowActionFlow</name></types>
     !-->

    <!-- Retrieve the wildcard package definition -->
    <sf:retrieve
    username="${sf.username}"
    password="${sf.password}"
    serverurl="https://login.salesforce.com"
    retrieveTarget="dump"
    unpackaged="dump/package.xml"
    pollWaitMillis="1000" />
</target>
1
  • 1
    The Force.com IDE has one big bonus, though; you can search by regular expressions. Download your entire org's configuration, then search for something like ['"][a-zA-Z0-9]{15}['"] and you'll get a list of every possible string that looks like a hard-coded ID value, including validation rules, workflow rules, apex code, triggers, and so on. Of course, you'll get a few false positives, but it would still be far easier than a manual search. Of course, Linux folk have it easy with grep, awk, and so on, but for Windows...
    – sfdcfox
    Feb 4 '14 at 19:23

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.