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.

circle-exclamation

Deployment

circle-info

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 will show you how to add a pre-destructive change.

Adding Destructive Changes

1

Select a Branch

  1. Click Code from the left sidebar menu.

  2. Select a branch from the list.

2

Add Desctructive Changes

  1. Scroll down to the Destructive changes section.

  2. Click Add per destructive changes.

  3. Select the Source Type:

    1. Connection: Lets you choose components from a Salesforce org connection to include in destructive changes.

    2. Branch: Lets you choose components from a branch to include in destructive changes.

  4. Click Select for the Connection or Branch from which you want to add components.

  5. Click Next.

3

Select Components

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

  2. Click Add for each component to add.

  3. Click Next once all components are added.

  4. The components you added will be listed in the Destructive changes table. The type of destruction is listed to the right of the component name.

Managing Destructive Changes

After adding a component to the Destructive Changes table, you can manage it by editing its deployment type or removing it.

1

Edit Destructive Change

circle-info

When editing a destructive change, the only option is to alter the deployment type.

  1. Click the Three Dots menu for the destructive change you want to edit.

  2. Click Edit.

  3. Select the Deploy Type.

  4. Click Save.

2

Delete Destructive Change

  1. Click the Three Dots menu for the destructive change you want to edit.

  2. Click Delete.

  3. Click Yes.

Last updated

Was this helpful?