Deploying Code with the Force.com IDE

Once you have created application components and tested them in your own development organization, you usually want to migrate them to a different organization for testing, staging, publication, or production use by end users.

Though each Force.com metadata component lives and runs in a particular organization on Force.com servers, the metadata files you work with in the Force.com IDE are portable from one organization to another. Deploying is the process of pushing your local project files into a different Salesforce organization than your project’s home organization. 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 new project with only the components you want to deploy. For information, see Create New Force.com Project.

If you deploy to a production organization, you must meet the Apex testing compliance policy: 75% of your Apex must be covered by unit tests, and all of those tests must complete successfully. Additionally, 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 organization. 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 organization 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. Click Next to execute the deployment.
  4. The Deployment Result page displays the result of the deployment. You should see Success displayed at the top of the page. If you do not, 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.