Newer Version Available

This content describes an older version of this product. View Latest

Special Behavior in Metadata API Deployments

Important considerations for specific types and contents of a deployment.

When deploying changes to an organization, consider how individual components in your deployment behave so you’re including all the changes you need to be successful. Use the following information to help you determine what to include in your deployment, and how the changes appear in the destination organization.

Apex Classes and Apex Triggers
Cancel scheduled Apex jobs before deploying changes to Apex code. Reschedule the jobs after the deployment.
Approval Processes
  • To use approval processes on Salesforce Knowledge articles with the Metadata API, the article type must be deployed. For article version (_kav) in approval processes, the supported action types are: Knowledge Action, Email Alert, Field Update, and Outbound Message.
  • If the approval process references any post templates that contain custom fields, then you need to resave those post templates in the originating organization before adding them to the change set. From Setup, click Create | Workflow & Approvals | Post Templates. For each post template, click Edit and then Save.
  • The metadata doesn’t include the order of active approval processes. You may need to reorder the approval processes in the destination organization after deployment.
  • If you change the Unique Name of an approval process that was previously included in a change set and deployed in another organization, and you resend the approval process via a change set, a new approval process will be created upon deployment in the other organization. The previously deployed approval process will not be modified.
Custom Fields
  • While you can access Lookup and Picklist fields with the Metadata API, other standard fields cannot be accessed, even though you can customize some of these fields in the UI
  • You cannot change the data type of a field using the Metadata API. You must manually make this change to the target organization through the user interface.
  • Starting in API version 30.0, when deploying a new custom field, the default values for the editable and readable fields in profile field permissions are false. To override the default values, include field permissions for the new field in your profiles.
Custom Objects
Using API version 29.0, you can’t change the sharingModel of an object using the Metadata API. You must manually make this change to the target organization through the user interface.

Starting with API version 30.0, you can change the sharingModel of an object for internal users using the Metadata API and the user interface.

Apex Classes and Apex Triggers
Cancel scheduled Apex jobs before deploying changes to Apex code. Reschedule the jobs after the deployment.
Connected App
  • You cannot set the consumerKey in the Metadata API. It is included in a retrieve operation for informational purposes. If you try to move the connected app to another organization, you must remove the consumerKey from the .zip file before the deployment to an organization. A new key will be generated in the destination organization.
  • Mobile settings of connected apps are not supported in change sets and must be manually migrated.
Page Layout
A deployment containing page layout assignments replaces all existing page layout assignments in the destination organization with those specified in the .zip file. Existing page layouts in the organization disappear if they’re not included in the .zip file. Always include all page layouts for all required record types in the .zip file.
Sharing
Simultaneously updating the sharingModel field for an object and adding a new sharing rule isn’t supported in the Metadata API, regardless of which object you’re updating. For example, you can add a sharing rule when the organization-wide default is public, and subsequently update the sharingModel. This would result in a single sharing recalculation.
Workflow
Test mode for flow triggers isn’t supported in the Metadata API. If you want a flow trigger to run the latest flow version when an administrator causes the workflow rule to fire, enable test mode via the user interface after deployment.