Apex - Deployment
Apex programming tutorial
Apex - Deployment
What is deployment in SFDC?
So far have developed some code in Developer Edition, but in a real scenario you need to do this development in Sandbox and then you might need to deploy it to another sandbox or environment production and this is called deployment. In short, it is the movement of data from one organization to another. The reason is that you can't develop Apex in your Salesforce production org. Live users who access the system while you are developing can destabilize your data or corrupt your application.
Tools available for deployment -
- IDE Force.com
- Change Sets
- SOAP API
- Force.com Migration Tool
We use the Developer Edition for our development needs and learning, we can not use the set of modifications or other tools that require enterprise SFDC or other paid edition. Therefore, we will work out how to deploy Force.com IDE in this tutorial.
Force.com Eclipse IDE
Step 1 - Open Eclipse and open the class trigger that needs to be deployed.
Step 2 - Once you click on 'Deploy to server ', enter the username and password of the organization where the component is to be deployed.
By performing the steps mentioned above, your Apex components will be deployed in the target org.
Deployment using change set
You can deploy validation rules, workflow rules, Classes Apex and Trigger from one organization to another by connecting them via the deployment settings. In this case, the organizations must be connected.
To open the deployment configuration, follow the steps below- below. Remember that this feature is not available in Developer Edition -
Step 1 - Go to Configuration and find 'Deploy '.
Step 2 - Click on 'Outbound Change Set ' to create a set of changes to deploy.
Step 3 - Add components to the change set using the 'Add ' button then Save and click on Download.
Step 4 - Go to the target organization and click on the incoming change set and finally click on deploy.
SOAP API calls to deploy
We will just have a small overview of this method as it is not a commonly used method.
You can use the method calls given below to deploy your data.
- compileAndTest ()
- compileClasses ()
- compileTriggers ()
Force.com Migration Tool
This tool is used for é deployment. You need to download the Force.com Migra tooltion, and then perform the file-based deployment. You can download the Force.com Migration Tool and then deploy by.