Loading

Deployment Error in production when sandbox has above 75% code coverage

게시 일자: Jun 25, 2026
상세 설명

When deploying Apex code to a Salesforce production org, you may encounter a deployment error even though your test classes show 100% code coverage in the sandbox. This occurs because Salesforce evaluates overall code coverage across all Apex classes and triggers in the production org, not just the components being deployed. If the combined coverage of all existing production components falls below 75%, the deployment fails — regardless of the coverage achieved in sandbox.

솔루션

Why Sandbox Coverage Doesn't Guarantee Production Success
Salesforce measures code coverage at the org level in production. Even if your new Apex code and its test classes achieve 100% coverage in sandbox, other existing Apex classes and triggers in production may have low or no coverage. When the total org-wide coverage falls below 75%, the deployment fails.

Steps to Resolve
To ensure a successful deployment:

  • Verify that all existing Apex classes and triggers in production have above 75% individual code coverage.
  • Ensure all classes are valid and recompiled (no compilation errors).

 

Knowledge 기사 번호

000386925

 
로드 중
Salesforce Help | Article