Salesforce Deployment – Best Practices

Everyone who works with Salesforce should be hearing the term Deployment every once in a while. The deployment process enables you to safely transfer a wide variety of new developments from your sandbox to your production.

Everyone who works with Salesforce should be hearing the term Deployment every once in a while. The deployment process enables you to safely transfer a wide variety of new developments – be it validation rules, custom objects, new fields or apex code or a huge range of other components – from your sandbox (You don’t use a sandbox? Better start doing so!) to your production instance.

However working with the standard Salesforce UI can be tricky. Your administrators might’ve experienced trouble while using Change Sets. Since they seem to be the go-to way to fire a deployment, Change Sets suffer from very long loading times (It might take 30+ minutes until a change set is available on the target platform!) and of course a very low usability. For every component type you want to deploy, you have to navigate through a huge dropdown list and then search for the specific component name.

 

This is not fun. However, Salesforce offers to its users another way to deploy, and it’s a fast way: a deployment based on a package.xml file. This file contains a list of all components you want to deploy. Please go ahead and check out the Salesforce Metadata API to learn more about this.

 

However once you were able to create a package.xml file, you can choose between two ways to a) retrieve the components from the source organization and b) deploy them to the target organization.

So here’s way no. 1: the Force.com Migration Tool.

 

Migration Tool

 

Navigate to Setup -> Tools, then check out the Force.com Migration tool. Basically you’ll need to install Apache ANT and be familiar with the command line of your operating system to be able to use that tool.

Once the tool is set up, you can easily configure deploy- and retrieve-calls.

 

Another possibility which is a bit slower but easier to use, is to log in to the Salesforce Developer workbench, navigate to the corresponding tab and choose “retrieve” or “deploy” from the dropdown menu.

tl;dr:

Deployment is recommended in three ways:

  1. Inbound/Outbound Change Sets
  2. Deployment via the Salesforce Migration Tool (ANT)
  3. Using the developer workbench

The package.xml file can be autogenerated from SFDC if you have a list of components available. One of our customers uses a salesforce object with a text field to maintain deployment instructions – this field can be automatically read by an apex class that gathers the deployment instructions and lets you download those instructions in the correct xml format from a visualforce page.

 

Overall, the deployment process doesn’t need to necessarily take up to several hours. Components can be gathered, retrieved and deployed within minutes only. It is your choice.

 

The following two tabs change content below.

Lukas Heinen

Lukas is a Junior Developer at Aptly. Since he's a qualified IT specialist, his blogposts broach the issue of everday as well as special challenges and experiences, which evolve from the usage of webbased cloud-technologies like Salesforce.

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.