+ Start a Discussion
InternalServerErrorInternalServerError 

How to check if a class is referenced anywhere else?

We have many classes on our org, some of them were developed many years ago and there is one that it looks like is a bit outdated and has 0 % code coverage, I have the feeling that is not in use and could be deleted, is there any way to check if this class is in invoked by a trigger or anywhere else?

 

Thanks.

Best Answer chosen by Admin (Salesforce Developers) 
Navatar_DbSupNavatar_DbSup

Hi,

 

In developer console you can check the relationship of apex class and pages. But you cannot check the relationship between a trigger and apex class.

 

Follow the below steps to cheek apex class, trigger and pages in developer console

  1. Setup->Developer console
  2. Click on Repository tab present in developer console
  3. Click on classes from Setup Entity type
  4. All the classes will display in entities
  5. Click on any class relationship with object, page and with others will display in Related window.

Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved. 

 

 

 

All Answers

Navatar_DbSupNavatar_DbSup

Hi,

 

In developer console you can check the relationship of apex class and pages. But you cannot check the relationship between a trigger and apex class.

 

Follow the below steps to cheek apex class, trigger and pages in developer console

  1. Setup->Developer console
  2. Click on Repository tab present in developer console
  3. Click on classes from Setup Entity type
  4. All the classes will display in entities
  5. Click on any class relationship with object, page and with others will display in Related window.

Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved. 

 

 

 

This was selected as the best answer
nick1505nick1505

Hi,

 

The best way here could be checking with the debug logs and see what all artifacts are being called when the above trigger is executed.

 

Let me know if it works for you!

 

InternalServerErrorInternalServerError

I was provided with a code snippet that checks if a class is referenced anywhere else! :)