Adding Pre and Post Destructive Changes to a Branch
Use destructive changes to remove Salesforce metadata components during deployment. You can configure them as Pre or Post to control when the deletions happen.
Overview
Destructive changes allow you to delete metadata from a Salesforce org as part of a deployment. For example, you may want to remove unused fields, classes, or components. In Flosum DevOps, destructive changes can be applied in two ways:
Pre-destructive changes: deletions occur before the main deployment.
Post-destructive changes: deletions occur after the main deployment.
Deployment
When you run a Deploy or Validate action, destructive changes are included automatically. They execute in sequence, depending on whether they are Pre or Post.
Best Practices
Use pre-destructive changes to remove metadata that might conflict with the new deployment.
Use post-destructive changes to clean up after the new components are deployed.
Always validate deployments with destructive changes to ensure no critical metadata is deleted by mistake.
Since the steps for adding a pre-destructive change and a post-destructive change are the same, this article shows you how to add a pre-destructive change.
Adding Destructive Changes
Add Destructive Changes
On the Components tab, click the Destructive Changes table selector.
Click + Add Pre Change.

Select the Source Type:
Organization: Lets you choose components from a Salesforce org to include in destructive changes.
Branch: Lets you choose components from a branch to include in destructive changes.
Click Continue.

Click Select for the Organization or Branch from which you want to add components.
Click Next.

Select Components
Search, filter, and sort to find the components to add to the destructive changes.

Click Select for each component to add.
Click + Add once all components are selected.

The components you added are listed in the Destructive Changes table. The Deploy Type column shows whether each change is Pre or Post.

Managing Destructive Changes
After adding a component to the Destructive Changes table, you can manage it by changing its deployment type or removing it completely.
Change Deployment Type
You can switch the deployment type between Pre and Post. The Change to Post/Pre option depends on the Deploy Type the destructive change is currently set to.
Click the Three Dots menu for the destructive change you want to update.
Click Change to Post/Pre.

The destructive change will immediately switch Deploy Types.
Last updated
Was this helpful?


