0

I am new to coding in Apex, but understand java and other object oriented languages. I am looking to use an API (such as the Tooling and SOAP API's) to compare fields in my Case object in my org. An example of fields I would be comparing is two fields with the same name and different API name, Billing Email (Billing_Email_For_.....__c) and Billing Email (Billing_Email__c). Optimally I would want to compare if the fields are used in the same validation rules, page layouts, etc. The overall goal of this script is to use it for eventual consolidation of fields that don't need to be in my org.

2 Answers 2

1

Salesforce provides Salesforce Optimizer which provides a report for clean up purpose (one of the purposes).

You should use this rather than building for scratch.

Salesforce Optimizer evaluates the following features:

Platform features:

  • Administrator permissions
  • Apex triggers
  • API versions
  • App performance (beta)
  • Dashboards
  • Data storage limits
  • Chatter
  • Fields
  • File storage limits
  • Files adoption
  • Hard-coded URLs
  • My Domain
  • Page layouts
  • Permission sets
  • Process Builder
  • Profiles
  • Record types
  • Reports
  • Roles
  • S-controls
  • Sharing rules
  • Users’ login activity
  • Users who access Salesforce on unsupported browsers
  • Validation rules
  • Workflow rules

Sales Cloud features:

  • Duplicate management
  • Lightning Sales Console
  • Path

Service Cloud features:

  • Case Feed
  • Lightning Service Console
  • Macros
  • Omni-Channel

Keyboard shortcuts

1
  • I had ran the optimizer report but my org is so large that it is unable to analyze, This is in the box that would have the field clean up information: 'Your implementation contains too many records to analyze.' Commented Jul 25, 2018 at 18:09
0

There's a new piece of functionality in pilot for Summer '18 that you may want to wait for to tackle this one: the Dependency API.

At present, to trace all the usages of specific fields, you would need to pull down essentially all of the metadata in your org and grep across it. That's actually the usual recommendation here when people need to find usages of Field A or Class B: use an IDE to pull all your metadata and run a global search. You can do that programmatically with the Metadata API, but it's not nearly as structured a process as you might want.

The upcoming Dependency API will provide a Tooling API-queryable MetadataComponentDependency resource that will trace these entity-to-entity relationships. You'll be able in your client to perform those queries and analyze the dependency information.

You must log in to answer this question.

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