> For the complete documentation index, see [llms.txt](https://docs.flosum.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.flosum.com/devops/code/branch-actions/using-branch-predeploy-fix.md).

# Using Branch PreDeploy Fix

## ![](/files/RXx59Hu9EyPCisSQ0YzA) Overview <a href="#what-is-pre-deploy-fix" id="what-is-pre-deploy-fix"></a>

The PreDeploy Fix is a validation process that inspects your branch for potential issues before deployment, such as:

* API version mismatches
* Missing components
* Broken references
* Unmet dependencies

If issues are detected, they are listed with options for resolution. This process helps prevent deployment failures by:

* Checking and updating component API versions
* Retrieving missing metadata
* Removing or updating references to problematic components

By addressing these aspects, your deployment becomes cleaner and less error-prone.

{% hint style="info" %}

#### Best Practices

* Always run a PreDeploy Fix before **Validate** or **Deploy** to reduce the chance of failures.
* For Missing Dependencies, use **Retrieve** when possible to ensure all dependencies are correctly included. Use **Remove** only when you’re sure the reference is obsolete or not needed.
* Enter clear and descriptive **commit messages**. These will show in the Commits tab for future tracking.
* Rerun PreDeploy Fix after resolving issues until the lists are empty.
* Use filters (status, type, date range) in **Activities** to quickly track your PreDeploy Fix jobs.
* Review logs whenever a job ends with **Exception** or **Action Required** to understand what needs fixing.
  {% endhint %}

## Run Branch PreDeploy Fix

{% stepper %}
{% step %}

### Select Branch and Run PreDeploy Fix

1. Click **Code** from the left sidebar menu.
2. &#x20;Select a branch from the list.&#x20;

   <div align="left"><figure><img src="/files/ruN63HF2fKiYZZBjNQe5" alt="" width="563"><figcaption></figcaption></figure></div>
3. Click the **Three Vertical Dots ⋮** dropdown menu next to Deploy.
4. Click **PreDeploy fix**.&#x20;

   <div align="left"><figure><img src="/files/RsJFQUzwXuBO1k5pG3hr" alt="" width="563"><figcaption></figcaption></figure></div>

{% endstep %}

{% step %}

### Select Connection

1. Click **Select** for the Salesforce org connection to run the PreDeploy Fix for.
2. Click **Run**.&#x20;

   <div align="left"><figure><img src="/files/m7zkJxI8wWaloqezryUO" alt="" width="563"><figcaption></figcaption></figure></div>
3. After starting the PreDeploy Fix job, it will be displayed on the **Activities** tab.&#x20;

   <div align="left"><figure><img src="/files/KhsVbDwAfO5M47mK3k92" alt="" width="563"><figcaption></figcaption></figure></div>

{% endstep %}
{% endstepper %}

## PreDeploy Fix Results

{% stepper %}
{% step %}

### View Results

1. Click the **Activities** tab.
2. Check that the **Pre Deploy Fix Search** job status is **Completed**.
3. Click the **Pre Deploy Fix Search** job.&#x20;

   <div align="left"><figure><img src="/files/i0nKb8hmvSbr1zykghf9" alt="" width="563"><figcaption></figcaption></figure></div>

{% hint style="info" %}
To help find a PreDeploy Fix job, you can click the **All Types** dropdown filter menu and select **Pre Deploy Fix Search**. This will filter the jobs to show just PreDeploy Fix jobs.
{% endhint %}
{% endstep %}

{% step %}

### API Version Errors

If the PreDeploy Fix detects any API version errors, they will appear in the **API Version Errors** table. This table shows each component with an API version error. To the right of each component are two API versions: the **Component API version** and the **Organization API version**. The Component API version is the one the component uses in the branch, and the Organization API version is the one it uses in the Salesforce org used as the connection for this PreDeploy Fix.&#x20;

{% hint style="info" %}
See the [#fixing-api-version-errors](#fixing-api-version-errors "mention") section below to learn how to resolve these errors.
{% endhint %}

1. Click the **API version errors** tab.&#x20;

   <div align="left"><figure><img src="/files/HEMyik3hTYblPzzDduDF" alt="" width="563"><figcaption></figcaption></figure></div>

{% endstep %}

{% step %}

### Missing Dependencies

If the PreDeploy Fix identifies any missing dependencies, they will be shown in the **Missing Components** table. This table displays each missing metadata dependency along with the component that references it. To fix missing components, you can choose from two options and apply them to each component as needed.

* **Retrieve**: This option retrieves the missing component and commits it to the branch.
* **Remove**: This option removes the reference to the missing component and should only be used if it is confirmed that deploying without the component in the branch is safe.

{% hint style="info" %}
See the [#fixing-missing-dependencies](#fixing-missing-dependencies "mention") section below to learn how to resolve these errors.
{% endhint %}

1. Click the **Missing dependencies** tab.&#x20;

   <div align="left"><figure><img src="/files/y4tU8dEkvMLsSmR9VKYc" alt="" width="563"><figcaption></figcaption></figure></div>

{% hint style="info" %}
If the **Missing dependencies** tab isn't visible, it means there are no missing dependencies.
{% endhint %}
{% endstep %}

{% step %}

### View Job Logs

You can view the PreDeploy Fix job logs to check for any job processing problems and to verify which Salesforce org the job was run with.

1. Click **See logs**.&#x20;

   <div align="left"><figure><img src="/files/QVEoXvC2IzsWB2QAbuNQ" alt="" width="563"><figcaption></figcaption></figure></div>
2. View the job status and log.&#x20;

   <div align="left"><figure><img src="/files/kzQ2qZmKfPB5727SLsf4" alt="" width="563"><figcaption></figcaption></figure></div>

{% endstep %}

{% step %}

### Re-Run PreDeploy Fix

Once you've fixed all API version errors and resolved missing dependencies, rerun the PreDeploy Fix job to ensure no issues remain. The following screenshots show a PreDeploy Fix job that completed without finding any issues.

{% hint style="info" %}
Both the **API version errors** and the **Missing componets** tables display **No Components**.
{% endhint %}

<div align="left"><figure><img src="/files/zosPGJtcz1hEkbaqY4Xp" alt="" width="563"><figcaption></figcaption></figure></div>

<div align="left"><figure><img src="/files/bV1xuNmKJkkuxw6CCAB2" alt="" width="563"><figcaption></figcaption></figure></div>
{% endstep %}
{% endstepper %}

## Fixing API Version Errors

If the **PreDeploy Fix** found API version errors, you can fix them by updating to the correct version.

{% stepper %}
{% step %}

### Update Versions

1. Click **Update Versions**.&#x20;

   <div align="left"><figure><img src="/files/2vKKoF1uXmNigzo0TlBt" alt="" width="563"><figcaption></figcaption></figure></div>
2. Click **Add** for each component to update the API version.&#x20;
3. Click **Update**.&#x20;

   <figure><img src="/files/4iUJrDLBTgpSDsJCW04T" alt=""><figcaption></figcaption></figure>
4. Enter a **Commit Message** for the changes to the branch.
5. Click **Resolve**.&#x20;

   <div align="left"><figure><img src="/files/B1CQ4PLLSNKUNFazeVod" alt="" width="375"><figcaption></figcaption></figure></div>
6. After starting the API Update job, it will be displayed on the **Activities** tab as a **Pre Deploy Fix Update** job.&#x20;

   <div align="left"><figure><img src="/files/IVq51Afvvy6bKLPcxcuX" alt="" width="563"><figcaption></figcaption></figure></div>

{% endstep %}

{% step %}

### View Results

1. Click the **Pre Deploy Fix Update** job.&#x20;

   <div align="left"><figure><img src="/files/E7myD7ew2g4PZENNlRE5" alt="" width="563"><figcaption></figcaption></figure></div>
2. View the job status and log.&#x20;

   <div align="left"><figure><img src="/files/QlGctNU50qSVxZWpkHB8" alt="" width="563"><figcaption></figcaption></figure></div>

{% endstep %}
{% endstepper %}

## Fixing Missing Dependencies

{% stepper %}
{% step %}

### Retrieve Missing Components

The selected metadata will be retrieved into your branch and added as a commit.

{% hint style="info" %}
If you have alread Removed dependency components, don't select them to retrieve. If you are unsure, you can rerun the PreDeploy Fix job.
{% endhint %}

1. Click **Retrieve**.&#x20;

   <div align="left"><figure><img src="/files/cfbWVWMCnZzhRec6GWKf" alt="" width="563"><figcaption></figcaption></figure></div>
2. Click **Add** for each dependency component to retrieve.
3. Click **Retrieve**.&#x20;

   <div align="left"><figure><img src="/files/O9JRfyi295kLewE6h3Wr" alt="" width="563"><figcaption></figcaption></figure></div>
4. Enter a **Commit Message** for the changes to the branch.
5. Click the **Connection** dropdown menu.
6. Select the Salesforce org to retrieve the dependent components from.&#x20;

   <div align="left"><figure><img src="/files/zEyxdkommnGCjjEOllA3" alt="" width="375"><figcaption></figcaption></figure></div>
7. Click **Run**.&#x20;

   <div align="left"><figure><img src="/files/YTvFWHP5RvdFTPtW2k2G" alt="" width="375"><figcaption></figcaption></figure></div>
8. After starting the Retrieve Missing Dependencies job, it will be displayed on the **Activities** tab as a **Pre Deploy Fix Update** job.&#x20;

   <div align="left"><figure><img src="/files/ZRXMAWCU36xCoy7cuCf8" alt="" width="563"><figcaption></figcaption></figure></div>

{% endstep %}

{% step %}

### Remove Missing Components

The references to those components are removed from your branch, preventing deployment errors.

{% hint style="info" %}
If you have alread Retrieved dependency components, don't select them to remove. If you are unsure, you can rerun the PreDeploy Fix job.
{% endhint %}

1. Click **Remove**.&#x20;

   <div align="left"><figure><img src="/files/kq5qYfuUMotXDFQkQGRj" alt="" width="563"><figcaption></figcaption></figure></div>
2. Click **Add** for each dependency component to retrieve.
3. Click **Remove**.&#x20;

   <div align="left"><figure><img src="/files/BKKkyBcalLFRKRkVJ8E7" alt="" width="563"><figcaption></figcaption></figure></div>
4. Enter a **Commit Message** for the changes to the branch.
5. Click **Run**.&#x20;

   <div align="left"><figure><img src="/files/AtazycOHrKTXG5agGeWG" alt="" width="375"><figcaption></figcaption></figure></div>
6. After starting the Remove Missing Dependencies job, it will be displayed on the **Activities** tab as a **Pre Deploy Fix Remove** job.&#x20;

   <div align="left"><figure><img src="/files/dMokpgdPfuRLakcI5mlE" alt="" width="563"><figcaption></figcaption></figure></div>

{% endstep %}

{% step %}

### View Results

1. Click the **Pre Deploy Fix Retrieve** job for retrieving components or **Pre Deploy Fix Remove** job for removing components.&#x20;

   <div align="left"><figure><img src="/files/0L5AYfBh93Pv7OY4m6ZU" alt="" width="563"><figcaption></figcaption></figure></div>
2. View the job status and log.&#x20;

   <div align="left"><figure><img src="/files/UWs4k0LOe0M1IKzSioP3" alt="" width="563"><figcaption></figcaption></figure></div>

{% endstep %}
{% endstepper %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.flosum.com/devops/code/branch-actions/using-branch-predeploy-fix.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
