Newer Version Available

This content describes an older version of this product. View Latest

Using the Force.com IDE to Deploy Apex

The Force.com IDE is a plug-in for the Eclipse IDE. The Force.com IDE provides a unified interface for building and deploying Salesforce applications. Designed for developers and development teams, the IDE provides tools to accelerate Salesforce application development, including source code editors, test execution tools, wizards and integrated help. This tool includes basic color-coding, outline view, integrated unit testing, and auto-compilation on save with error message display.

The Force.com IDE is a free resource provided by Salesforce to support its users and partners but isn't considered part of our services for purposes of the Salesforce Master Subscription Agreement.

Note

To deploy Apex from a local project in the Force.com IDE to a Salesforce organization, use the Deploy to Server wizard.

If you deploy to a production organization:

  • Unit tests must cover at least 75% of your Apex code, and all of those tests must complete successfully.
  • Every trigger must have some test coverage.
  • All classes and triggers must compile successfully.
Note the following.
  • When deploying Apex to a production organization, each unit test in your organization namespace is executed by default.
  • Calls to System.debug are not counted as part of Apex code coverage.
  • Test methods and test classes are not counted as part of Apex code coverage.
  • While only 75% of your Apex code must be covered by tests, don’t focus on the percentage of code that is covered. Instead, make sure that every use case of your application is covered, including positive and negative cases, as well as bulk and single records. This approach ensures that 75% or more of your code is covered by unit tests.

Note

For more information on how to use the Deploy to Server wizard, see “Deploy Code with the Force.com IDE” in the Force.com IDE documentation, which is available within Eclipse.