A sandbox is a copy of your production organization. Sandboxes contain the same metadata—which is configuration information such as the types of custom objects and fields, applications, and workflows—as your production organization. That metadata, as well as data in the case of a full sandbox, is copied to a new organization, completely isolated from your production organization. Operations you perform in your sandbox don’t affect your production organization, and vice versa.
Sandboxes are available in Enterprise, Unlimited, and Performance Editions. With Unlimited and Performance Edition, you can create multiple sandbox copies of different types. These sandboxes can be used for a variety of purposes, without compromising the data and applications in your Salesforce production organization. For example, you might have one sandbox for development, another sandbox dedicated to testing, and a third sandbox for training. Each sandbox instance is isolated from every other sandbox instance, just as they are from production.
For development tasks that are slightly more complex or that must be isolated from the production organization, you can use a separate development environment, usually a sandbox. In this scenario, all of the development and testing occurs in the development environment, and then the changes are promoted to the production organization.
Typical development lifecycle: (in Sandbox organization)
- Create a development environment
- Develop using Salesforce Web and local tools
- Test within the development environment
- Replicate production changes in the development environment
- Deploy what you’ve developed to your production organization
Limitations of the Production Organization: You cannot write Apex code directly in a production organization.
Typical development lifecycle: (in Production organization)
- Plan functional requirements
- Develop using Salesforce Web Tools, using profiles to hide your changes until they are ready to deploy
- Update profiles to reveal your changes to appropriate users
- Notify end users of changes
If you are simultaneously developing projects in production and sandbox organizations, consider tracking setup changes you make in the production organization and replicating them in the sandbox. This is important because if your sandbox has out-of-date customizations, you might inadvertently replace your newer changes in production with these older customizations when promoting them from sandbox.
Typical development lifecycle: (Complex Projects)
- Create development environments
- Develop using Salesforce Web and local tools
- Create testing environments, including UAT and Integration
- Migrate changes from development environment to integration environment
- Test
- Migrate changes from integration environment to UAT environment
- Perform User Acceptance Tests (UAT)
- Migrate changes from UAT environment to staging environment
- Replicate production changes in staging environment
- Schedule the release