function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
RichardR1RichardR1 

How to know if an Apex class is not in use?

Hi all, I'm trying to learn Apex. I need to update some triggers but our org code coverage is below the requirement. I think it's because of some Apex classes and I'm not sure if I can delete/ deactivate them. How do I check that?
Best Answer chosen by RichardR1
SwethaSwetha (Salesforce Developers) 
HI Richard,
Please see 
https://salesforce.stackexchange.com/questions/8437/is-there-a-way-to-find-out-where-a-class-is-used-other-than-attempting-to-delet

https://salesforce.stackexchange.com/questions/274250/how-to-determine-if-an-apex-class-hasnt-been-used-recently

These links have approaches you can use to find out the apex class dependencies and their usage.
Incase you are planning to deactivate triggers/ apex classes note that common known issue while deactivating trigger is code coverage (more than 75%). Especially, if the trigger you are turning off has lots of code, it will definitely impact your overall code coverage.  So, be ready with your test classes for the other existing apex classes/triggers.

Related : https://salesforce.stackexchange.com/questions/5776/deleting-triggers-classes-from-production#:~:text=You%20cannot%20delete%20a%20class,deploy%20these%20deletions%20to%20Production.
 
Hope this helps you. Please mark this answer as best so that others facing the same issue will find this information useful. Thank you