• Warren Rudman 7
  • NEWBIE
  • 0 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
Hello folks, 

Today we were trying to work on a utility that will list out all references to a field. This is intented to help the business to analyze a field before they plan to update/delete it. 

What we are trying to achieve?
- Once the user selects an object and one of its fields, we want to list out all possible components where the selected field is referenced. 

What were we able to achieve, using what?
- We first tried the Standard SOQL approach and queried objects such as ApexClass, ApexComponent, ApexPage and ApexTrigger : this helped us to find out references of a field in the code by scanning their body/markup. 
- We then thought of utilizing the Tooling API that has a SOSL feature, using which we were able to retreive all the codes where the field was referenced. 
Code snippet:
/services/data/v34.0/tooling/search/?q=FIND{BillingCity}

This gives me a list of all code where there is "BillingCity" referred. 

However, none of the approaches has helped us to touch other components such as:
- formula field
- report filters
- workflow field updates

Wanted to understand how do we get around this?
I know this is possible using Tooling API but then if I end up making one http callout for each component then I am going to make a lot of callouts. 
Is there something I am missing here? 
Need some guidance around this. 

Many thanks in advance!