Deploy Code with the Force.com IDE

After you have created application components and tested them in your own development org, you usually want to migrate them to a different org. The second org is used for testing, staging, publication, or production use by end users.

Although each metadata component lives and runs in a particular org, the metadata files you work with in the Force.com IDE are portable from one org to another. Deploying is the process of pushing your local project files into a different Salesforce org than your project’s home org. The Force.com IDE provides the Deploy to Server wizard to guide you through the deployment process.

Before you deploy, you can streamline your deployment process by creating a project with only the components you want to deploy. For information, see Create a Force.com Project.

If you deploy to a production org, you must meet the Apex testing compliance policy: 75% of your Apex must be covered by unit tests, and all those tests must complete successfully. Also, each trigger must have some code coverage.

Note

To open the Deploy to Server wizard, right-click the src folder of the project and select Force.com | Deploy to Server. You can also select individual classes or triggers, multiple classes and triggers, or the classes or triggers folder. Before the wizard opens, the IDE checks for conflicts between the project and the home org. If conflicts are found, you are given the option to synchronize before continuing.

The Deploy to Server wizard includes the following pages.

  1. On the Destination Details page, enter the connection information for the target org and click Next.
  2. On the Archive Options page, optionally create backup files for this deployment and click Next.
  3. On the Deployment Plan page, review the actions to be performed in this deployment. To execute the deployment, click Next.
  4. The Deployment Result page displays the result of the deployment. If you don’t see Success displayed at the top of the page, review the deployment logs by clicking View Logs. If you need assistance with deployment errors, click Save to save your log file for future reference.