Any code development should be always done in Sandbox and when it is ready for go live then deployed to production system.

Depended on how big team you have and Salesforce version you may use one of two schematics.

Developers Sandbox --> Production system

This is basic scenario for small projects on Enterprise edition as you may have only one Sandbox there.

+ easy to use, cheaper licenses

- difficult testing, due to continuous change in code
- may require pauses in development for time of testing

Developers Sandbox --> UAT Sandbox --> Production system

This is better solution when you have bigger project, bigger team and testers.
Multiple sandboxes are available on Unlimited edition or with additional fee to Enterprise edition.

+ Tester may test finished functionality in UAT Sandbox
+ Developers may work continuously and release finished functionality to UAT Sandbox for testing.

- When you buy it as extension to Enterprise edition price is multilayer by all users accounts, even if you do not need that much.

There are few ways how to deploy finished functionality. In this article I will cover Deployment using GUI (only browser) and Force IDE.

Deployment using GUI

This example is based on Developers Sandbox --> Production system case.

First of all we need to know what is the name of Sandbox which will be a source for deployment in our case it will be "AS" .

Setting up Deployment Connections

We need to check Deployment Connections if we can transfer changes to production from particular Sandbox.
Go to Setup -> App Setup -> Deploy -> Deployment Connections

To approve this Sandbox for uploading changes to production click on Edit and choose "Allow Inbound Changes".

Accept Outbound Changes may be checked if you need to transfer something from Production to Sandbox, but it can be checked only in Sandbox settings, not in production system.

After Save there should be a green arrow pointing left for your Organization name.

Completing deployment package.

Now go to Sandbox, then Setup -> Deploy -> Outbound Change Sets.

To improve comfort of work you may open Sandbox and Production in two different browsers then fit it to half of a monitor size and tile together.

Click on "New" and give it name and short description, click Save.

Now you see Change Set overview window.

In section "Change Set Components" you need to click on Add button and select all components that should be copied to production system.
When done click on "View/Add Dependencies" to see how many additional components are connected and may be needed.

When finished go to section "Profile Settings For Included Components" and add Profiles which are affected by new changes.

If you omit this section then no oWhen done click on "View/Add Dependencies" to see how many additional components are related to selected one and may be will have access to objects, fields, classes, pages and all new modifications so you must then set up it manually in production system which may be a lot of additional work to do.

Tips for components selection:

- Start selecting from "top" and relay on dependences. For example select new objects and then click on "View/Add Dependencies" to get a list of all fields for them.
- Make partial uploads. For first upload select new objects, fields and profiles, then create second upload including Classes and Pages. It is safer way.
- Remeber to add test classes manually as they are not found by "View/Add Dependences" button.

Uploading changes from Sandbox to destination

When you completed your package click on Upload button and choose were you want to upload changes.
In my case it will be Production but if you use UAT Sandbox then you will have more choices.

After clicking on (2) Upload you will be redirected to Change Set overview.
In few seconds you should see message: "Your change set was uploaded successfully."

Also email will be sent to you that upload was successful.

That's all from Sandbox side.

You may check status of all "Outbound Change Sets" in Setup -> Deploy -> Outbound Change Sets.

Importing changes to production system

Now in production Organization go to Setup -> Deploy -> Inbound Change Sets, this is a list of all awaiting changes.

Now click on Validate (1), import screen will be opened.

It is always good rule to validate package (1) first, then deploy (2).

Validation may take some time depended of how many components are in. When finished section "Deployment History" is updated.

Most important is Status if it is "Succeeded" then we can continue with Deployment, otherwise click on "View Results" to see what component failed and why.

Even if succeed you may be curious what impact it have for current system, then click on "View Results" and you will see what will be Created, Modified or there is No Difference. Clicking on label expands a list.

So we checked everything and it is as we expected. Go back and click on "Deploy" button and wait.

After some time it will be finished and we will see new entry in "Deployment History".

You my distinguish validation from deployment by "Validate Only" check box, checked.

That's all, our changes are in production system.











© Paweł Woźniak