In Salesforce, there are couple of ways to move metadata between environments. Here we are going to learn about Change Management which consists of 10% in Salesforce Advanced Adminstrator Exam. Without further ado, let's get into it!
NOTE: This post is written in April 2019 and content might be changed/updated overtime. The content is inspired by focusonforce.com.
- When moving metadata between environments, there are certain possible of
- Unrelated Org -> Unrelated Org
Change Setsis the most common way to deploy metadata between related sandbox/production org through
- Steps to deploy metadata with
Allow Inbound Changesor
Accept Outbound Changesin Setup
Deployment Settings. (required to specify in both source and target organization)
- Navigate to
Outbound Change Setsand create a new
Change Set Componentsto be deployed.
- Upload to desired target organization.
- After finished uploading, navigate to target organization Setup
Inbound Change Sets. You can find the newly created
Change Sets Awaiting Deploymentsection.
- You can click
Validateto check for validation or
Deployif you are ready to deploy.
- You can monitor the status of
Change Setdeployment at
Deployment Statuspage. If deployment failed, you can click
View Detailsto find out the error that causes the failure.
- NOTE: if you are uploading custom code based components such as
Apextriggers, you will need to provide test case(s) that cover(s) at least 75% code coverage of the uploaded components.
- The available test options for
- Default - all local tests (no tests in sandbox)
- Run Local Tests - all tests except those from installed managed packages
- Run All Tests - all tests
- Run Specified Tests - only specified test class name separated by comma
,not break line!
- Special notes regarding to
- once the
Change Setcomponents are uploaded, you will not be able to modify the
Change Setcomponents anymore.
- the whole transaction will be rolled back if deployment is failed.
Add Profilescan be used to include profile settings such as custom object and field permissions. (the role, permission sets and etc. can be added via
Change Setcannot be used to rename or remove components.
- dependent components might require separate deployment (cannot deploy all at once)
- not all metadata types are supported by
Change Set(perform manually). For example,
web-to-lead, and etc.
- Supported components in
Change Set(to name a few):
- Approval Process (order of active approval process is not included and custom fields on standard project in approval page fields need to be manually added to a
- Assignment Rule / Auto Response Rule / Matching Rule / Duplicate Rule
- Custom Data Type / Custom Field /
- Custom Label / Setting / Report Type / Metadata Type / Object and etc.
- Compact Layout / Page Layout / Home Page Layout / Lightning Page
- List View
- Permission Set / Role / Sharing Criteria Rule
- Report / Dashboard / Reporting Snapshot
- Validation Rule
- Visualforce Page / Component
- Workflow Rule / Task / Field Update / Email Alert / Outbound Message
- and etc.
- once the
Force.com IDEis an
Eclipseplugin that is mostly used by developers for local development and deployment.
- It can be used to deploy components to any org, including an unrelated org. For example, metadata components can be deployed from
- Metadata components can be deleted from an org using
- Use of
Deploy to Serverwizard:
- Enter Destination Details
a. Username (user must have
Modify All Datapermission)
c. Security Token (needed if used by user)
d. Environment (Production/Developer Edition, Sandbox, Pre-Release, Other)
- Specifying Archive Options - define project and destination archives in case something went wrong that requires a recovery later
- Deployment Plan - select list of items that needs to be deployed (add, delete, overwrite or take no action on components)
Validate Deploymentis used to perform test of selected components to destination (no changes committed)
- Deployment Result - indicate whether the deployment is success or not.
- Enter Destination Details
Force.com Migration Tool
Force.com Migration Toolis a Java/Ant-based CLI for moving metadata between local directory and a Salesforce org.
- Useful for:
- lots of setup changes that takes a long time
- script deployments to multiple environments
- parameters to be used for repetitive deployments, making it suitable for multi-stage release processes
- schedule batch deployments
- move metadata between unrelated orgs (production -> production for example)
- 'build.xml' instructs ANT where and how to deploy and retrieve API calls.
- Components to be moved are described in 'package.xml' file.
- 'desctrutiveChanges.xml' is included to list metadata components when we need to delete certain metadata components in an org.
- Your credentials such as username and password are stored in 'build.properties' on local file system.
- Check out link here for more information on deploying with
Force.com CLIis the command line interface for
- Metadata can be exported and imported.
- It allows deployments using scripted commands and automated tasks.
- Difference between
Force.com Migration Tooland
Force.com CLIis that
Force.com CLIdoes not store username and password on local file system, user needs to login via command line.
Workbenchis a lightweight online tool for deploying or retrieving metadata components in production/sandbox environment.
workbenchis not an official salesforce.com product!
- URL: https://workbench.developerforce.com
- Things can be done in workbench:
- View object information, metadata types and components.
- Perform SOQL/SOSL query
- CRUD action interface
- Deploy and retrieve metadata components
- Execute REST API via REST Explorer
- Execute Apex Code
- and etc.
Packageis a bundle of components that make up an App or piece of functionality.
Unmanaged Packagecan be used to distribute open source projects or application templates.
- NOTE: do not use unmanaged package to migrate metadata between related orgs such as between sandbox and production.
- Unmanaged package components can be edited once they are installed in an org.
- In contrary,
Managed Packageis protected, upgradeable and typically sold on
Well, that's all about it! I hope you guys enjoy reading it!
Post was published on , last updated on .
Like the content? Support the author by paypal.me!