Loading
Salesforce Help 사이트 “Help Agent powered by Fin” 도입 안내더 많이 읽기
Tableau 고객 대상: Tableau를 이용하는 고객이 Help 사이트에서 사례(케이스)를 등록할 수 없는 경우의 대체 수단더 많이 읽기
Slack 관련 문의처가 Salesforce Help로 통합 및 변경됩니다.더 많이 읽기

Salesforce Apex: How to Find Unused Methods and Variables in code Using Tooling API SymbolTable

게시 일자: May 30, 2026
상세 설명

When working with large Salesforce projects containing many Apex classes, Visualforce pages, components, and triggers, it is useful to identify unused methods and variables to maintain clean, efficient, and maintainable code.
This article explains how to use the Salesforce Tooling API's SymbolTable object to identify Apex methods that are defined in a class but not referenced by any other Apex class.

솔루션

How to Use Tooling API SymbolTable
The Salesforce Tooling API can be used to retrieve the SymbolTable for each Apex class in your org. The SymbolTable contains:

  • methods — all methods defined within that Apex class
  • externalReferences — references to methods from other classes that are consumed within the class

By scanning the methods defined in each Apex class's SymbolTable and comparing them against the externalReferences found across all other classes, you can identify methods that are defined but never called by any other Apex class — indicating they are potentially unused.

Third-Party Canvas App Option
A community-built canvas app is already available to automate this SymbolTable analysis. Note: This is a third-party, community-developed tool and is not supported by Salesforce. See Spring Cleaning Apex Code with the Tooling API for details.

Important Limitation
This approach only scans Apex classes. It will not detect declarative references to methods from Visualforce markup. 

Knowledge 기사 번호

000387972

 
로드 중
Salesforce Help | Article