> 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-validate.md).

# Using Branch Validate

Validate checks your branch metadata against a Salesforce org without deploying. It confirms compatibility, ensures dependencies are satisfied, and runs Apex tests if required.

{% hint style="warning" %}

#### Written for the Old UI

This article was written for the old UI. The instructions are still usable, but the screenshots are outdated. In some cases, items referenced in the instructions have moved or changed. If you cannot find an item, see the [Where Did It Go](/devops/new-ui-ux-transition/where-did-it-go.md) article.
{% endhint %}

## ![](https://1800549522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRpUu5iMlzMFAudyBvMOl%2Fuploads%2FG5ZbxX918xOHwbAwAJ4n%2FSummary2-Small-Icon.svg?alt=media\&token=da26a67f-ff7f-47b3-8669-06be960dc2d7) Overview <a href="#what-is-validate" id="what-is-validate"></a>

The Validate feature checks your branch's components against a target Salesforce org **without deploying**. This ensures metadata compatibility, verifies dependencies, and runs Apex tests if needed. By validating before deployment, you can identify and fix issues, reducing deployment failures. Validation prevents failures by:

* Checking metadata compatibility with the target org
* Ensuring dependencies are satisfied
* Running Apex tests (based on selected test level)

This process gives you confidence that the deployment will succeed. In this article, you will learn how to run a Validation job and view the results.

{% hint style="info" %}

#### Best Practices

* Always run Validate before deploying into UAT or Production.
* Include dependent components to avoid validation errors.
* Use **Run Local Tests** in lower environments for higher quality checks.
* Use **Do not run tests** only for quick validations in sandboxes.
* Review logs carefully before proceeding with deployment.
* Re-run Validate after resolving conflicts, updating metadata, or retrieving missing dependencies.
  {% endhint %}

## Run Branch Validation Job

{% stepper %}
{% step %}

### Select Branch and Start Validation

1. Click **Code** from the left sidebar menu.
2. Select a branch from the list.

   <div align="left"><figure><img src="https://1800549522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRpUu5iMlzMFAudyBvMOl%2Fuploads%2FMF5U2AgC0IVyRELJXWsv%2FUsingBranchValidate-Run-S01-01.png?alt=media&amp;token=9f7fd50e-f2b5-4053-ad43-1f58fd427c34" alt="" width="563"><figcaption></figcaption></figure></div>
3. Click the **Three Vertical Dots ⋮** dropdown menu next to Deploy.
4. Click **Validate**.

   <div align="left"><figure><img src="https://1800549522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRpUu5iMlzMFAudyBvMOl%2Fuploads%2F9jej1YdpDM9j6srk602I%2FUsingBranchValidate-Run-S01-02.png?alt=media&amp;token=20471301-04fc-4b0b-938b-ae937eea405b" alt="" width="563"><figcaption></figcaption></figure></div>

{% endstep %}

{% step %}

### Select Components and Connections

1. Click **Add** for each branch component to include in the validation.
2. (Optional) Click **Add all** to add all components to the validation.
3. Click **Next**.

   <div align="left"><figure><img src="https://1800549522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRpUu5iMlzMFAudyBvMOl%2Fuploads%2FwOzj9OAMyIqbaRJjaIbx%2FUsingBranchValidate-Run-S02-01.png?alt=media&amp;token=3b2a29c0-8e62-4943-adbe-6ccc82ee5592" alt="" width="563"><figcaption></figcaption></figure></div>
4. Click **Select** for the Salesforce org connection to use as the target org for the validation.
5. Click **Next**.

   <div align="left"><figure><img src="https://1800549522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRpUu5iMlzMFAudyBvMOl%2Fuploads%2FM5hBgK6zJvsUlgSQnqmM%2FUsingBranchValidate-Run-S02-02.png?alt=media&amp;token=36f0a878-363f-415e-82b0-85fb76bcdfa9" alt="" width="563"><figcaption></figcaption></figure></div>

{% endstep %}

{% step %}

### Select Destructive Changes

{% hint style="info" %}
By default, all pre- and post-destructive changes are added.
{% endhint %}

1. (Optional) To remove a destructive change from the validation, click **Added**.
2. Click **Next**.

   <div align="left"><figure><img src="https://1800549522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRpUu5iMlzMFAudyBvMOl%2Fuploads%2FVTbXVP1YBS0c9LJ8pdq0%2FUsingBranchValidate-Run-S03-01.png?alt=media&amp;token=14cbc49b-bafe-4d09-906f-339a90a86ab8" alt="" width="563"><figcaption></figcaption></figure></div>

{% endstep %}

{% step %}

### Configure and Run Validation

1. Click the **Run tests** dropdown menu to choose the level of Apex testing to perform. See the table below for a description of each.

   <div align="left"><figure><img src="https://1800549522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRpUu5iMlzMFAudyBvMOl%2Fuploads%2F7vNJLaSjbWM3DnqUV1BM%2FUsingBranchValidate-Run-S04-01.png?alt=media&amp;token=bdbbd178-ad81-4c07-8852-d4b2502e67cf" alt="" width="563"><figcaption></figcaption></figure></div>

<table><thead><tr><th width="180.333251953125">Test Level</th><th>Description</th></tr></thead><tbody><tr><td><strong>Default</strong></td><td>Runs only the tests included in the package.</td></tr><tr><td><strong>Do not run tests</strong></td><td>Skips all Apex tests (allowed only in non-production orgs).</td></tr><tr><td><strong>Run local tests</strong></td><td>Executes all tests in the org except those from installed managed packages.</td></tr><tr><td><strong>Run all tests</strong></td><td>Runs every test in the org, including managed package tests.</td></tr><tr><td><strong>Run relevant tests</strong></td><td>Runs only the tests relevant to the selected components and their dependencies. This option uses Salesforce’s RunRelevantTests feature to automatically determine which tests to run. For more details, see <a href="https://help.salesforce.com/s/articleView?id=release-notes.rn_apex_run_relevant_tests.htm&#x26;release=260&#x26;type=5">Salesforce Help</a>.</td></tr><tr><td><strong>Run specified tests</strong></td><td>Lets you define individual test classes or methods to run.</td></tr></tbody></table>

2. Click the deployment settings toggles to enable the settings. See the following table for an explanation of each setting.

   <div align="left"><figure><img src="https://1800549522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRpUu5iMlzMFAudyBvMOl%2Fuploads%2FWELpcaRxByblsA4xU5sv%2FUsingBranchValidate-Run-S04-02.png?alt=media&amp;token=270d6f7f-6196-4ddb-915b-e99697f2203e" alt="" width="563"><figcaption></figcaption></figure></div>

<table><thead><tr><th width="280.333251953125">Setting</th><th>Description</th></tr></thead><tbody><tr><td><strong>Deploy profile settings only for selected components</strong></td><td>Only validate <strong>Profile Settings</strong> for the components you chose to include in this validation job.</td></tr><tr><td><strong>Deploy permission set settings only for selected components</strong></td><td>Only validate <strong>Permission Set Settings</strong> for the components you chose to include in this validation job.</td></tr></tbody></table>

3. Click **Run** to start the Validation job.

   <div align="left"><figure><img src="https://1800549522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRpUu5iMlzMFAudyBvMOl%2Fuploads%2FhNODemQFTXTfjNO7ZtlL%2FUsingBranchValidate-Run-S04-03.png?alt=media&amp;token=70c26313-2d7e-4c25-ab0e-e14d1d37988b" alt="" width="563"><figcaption></figcaption></figure></div>
4. After starting the Validation job, it will be displayed on the **Activities** tab.

   <div align="left"><figure><img src="https://1800549522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRpUu5iMlzMFAudyBvMOl%2Fuploads%2FJhBpFgtfYNxvAoIUKmQv%2FUsingBranchValidate-Run-S04-04.png?alt=media&amp;token=89903300-4024-41fc-b150-8fd7069477cd" alt="" width="563"><figcaption></figcaption></figure></div>

{% endstep %}
{% endstepper %}

## Validation Results <a href="#how-to-check-validation-status" id="how-to-check-validation-status"></a>

{% stepper %}
{% step %}

### View Results

1. Click the **Activities** tab.
2. Check that the **Validation** job status is **Completed**.

{% hint style="info" %}
If an error occurs during the Validation job, its status will change to **Exception**. Review the Validation job log to identify the errors.
{% endhint %}

<table><thead><tr><th width="159.6666259765625">Job Status</th><th>Description</th></tr></thead><tbody><tr><td><strong>Queued</strong></td><td>Job is created and waiting to run.</td></tr><tr><td><strong>In Progress</strong></td><td>Job is running.</td></tr><tr><td><strong>Completed</strong></td><td>Job completed successfully.</td></tr><tr><td><strong>Exception</strong></td><td>Job completed with errors.</td></tr></tbody></table>

3. Click the **Validation** job.

   <div align="left"><figure><img src="https://1800549522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRpUu5iMlzMFAudyBvMOl%2Fuploads%2FIQKZ9cXeOX0VWlWEaQbo%2FUsingBranchValidate-View-S01-01.png?alt=media&amp;token=f2cdae89-d121-4a69-92d8-99293ef6f6d1" alt="" width="563"><figcaption></figcaption></figure></div>
4. The **Validate** results page lists information about the job and a detailed log of the job.

   <div align="left"><figure><img src="https://1800549522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRpUu5iMlzMFAudyBvMOl%2Fuploads%2FIe0U497ovIZblH7YmIjN%2FUsingBranchValidate-View-S01-02.png?alt=media&amp;token=7fb837f7-1f7c-437e-813b-8c92b2b9661b" alt="" width="563"><figcaption></figcaption></figure></div>

{% endstep %}

{% step %}

### Review Log (No Errors)

In the Validation job log, details include:

* Presence of Destructive Changes objects.
* Count and list of validated components.
* Type and results of the Apex test run.
* Validation steps completed.

<div align="left"><figure><img src="https://1800549522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRpUu5iMlzMFAudyBvMOl%2Fuploads%2F7jZ2Zo6GTswLdv6qF1GO%2FUsingBranchValidate-View-S02-01.png?alt=media&amp;token=43785a97-4118-4be9-afb4-25f7f177ec58" alt="" width="563"><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}

### Review Log (With Errors)

When a Validation job error occurs, examine the log to find the cause. Focus on entries marked with **\[error]**. The screenshots below show a Validation job run in which a Salesforce org lacks multiple components that are included in the branch.

<div align="left"><figure><img src="https://1800549522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRpUu5iMlzMFAudyBvMOl%2Fuploads%2FkZFC3qKPu3soCbwRjJHg%2FUsingBranchValidate-View-S03-01.png?alt=media&amp;token=6b2e39e5-48a1-4f7b-bf55-51edd2a311e5" alt="" width="563"><figcaption></figcaption></figure></div>

<div align="left"><figure><img src="https://1800549522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRpUu5iMlzMFAudyBvMOl%2Fuploads%2FukmpgbJMZ8P4v97u4OHA%2FUsingBranchValidate-View-S03-02.png?alt=media&amp;token=4553a42c-7a93-4447-9b17-b67eb9da71e6" alt="" width="563"><figcaption></figcaption></figure></div>

The full log file is shown below:

{% code expandable="true" %}

```
[Jan 1, 2026 3:14 PM]: [info] Job started
[Jan 1, 2026 3:14 PM]: [info] Create salesforce project started
[Jan 1, 2026 3:14 PM]: [info] Create salesforce project completed
[Jan 1, 2026 3:14 PM]: [info] Retrieve salesforce components started
[Jan 1, 2026 3:14 PM]: [info] Retrieve salesforce components completed
[Jan 1, 2026 3:14 PM]: [info] Prepare manifests started
[Jan 1, 2026 3:14 PM]: [info] Prepare manifests completed
[Jan 1, 2026 3:14 PM]: [info] Salesforce metadata validation started
[Jan 1, 2026 3:14 PM]: [error] Validation failed
[Jan 1, 2026 3:14 PM]: [info] Number of validated components: 2
[Jan 1, 2026 3:14 PM]: [info] ValidateJobId: 0Afg5000001uyNVCAY
[Jan 1, 2026 3:14 PM]: [error] ApexClass SuccessPlanController: Invalid type: Objective__c
[Jan 1, 2026 3:14 PM]: [error] ApexClass SuccessPlanController: Invalid type: SuccessGoal__c
[Jan 1, 2026 3:14 PM]: [error] ApexClass SuccessPlanController: Variable does not exist: objective
[Jan 1, 2026 3:14 PM]: [error] ApexClass SuccessPlanController: Invalid type: Objective__c
[Jan 1, 2026 3:14 PM]: [error] ApexClass SuccessPlanController: Variable does not exist: LightningCommunityUtils
[Jan 1, 2026 3:14 PM]: [error] ApexClass SuccessPlanController: Variable does not exist: objective
[Jan 1, 2026 3:14 PM]: [error] ApexClass SuccessPlanController: Variable does not exist: objective.Owner
[Jan 1, 2026 3:14 PM]: [error] ApexClass SuccessPlanController: Variable does not exist: objective
[Jan 1, 2026 3:14 PM]: [info] Validated components: Example_Test_Object_1__c, CustomObject; Example_Test_Object_2__c, CustomObject
[Jan 1, 2026 3:14 PM]: [error] ApexClass SuccessPlanController: Variable does not exist: objectives
[Jan 1, 2026 3:14 PM]: [error] ApexClass SuccessPlanController: Variable does not exist: Account__c
[Jan 1, 2026 3:14 PM]: [error] ApexClass SuccessPlanController: Variable does not exist: LightningCommunityUtils
[Jan 1, 2026 3:14 PM]: [error] ApexClass SuccessPlanController: Invalid type: Schema.SuccessGoal__c
[Jan 1, 2026 3:14 PM]: [error] ApexClass SuccessPlanController: Invalid type: Schema.SuccessGoal__c
[Jan 1, 2026 3:14 PM]: [error] ApexClass SuccessPlanController: Invalid type: Schema.SuccessGoal__c
[Jan 1, 2026 3:14 PM]: [error] ApexClass SuccessPlanController: Invalid type: Schema.SuccessGoal__c
[Jan 1, 2026 3:14 PM]: [error] ApexClass SuccessPlanController: Invalid type: Schema.SuccessGoal__c
[Jan 1, 2026 3:14 PM]: [error] ApexClass SuccessPlanController: Variable does not exist: LightningCommunityUtils
[Jan 1, 2026 3:14 PM]: [error] ApexClass SuccessPlanController: Invalid type: Schema.Objective__c
[Jan 1, 2026 3:14 PM]: [error] ApexClass SuccessPlanController: Invalid type: Objective__c
[Jan 1, 2026 3:14 PM]: [error] ApexClass SuccessPlanControllerTest: Variable does not exist: GuidUtil
[Jan 1, 2026 3:14 PM]: [error] ApexClass SuccessPlanControllerTest: Invalid type: PortalSession__c
[Jan 1, 2026 3:14 PM]: [error] ApexClass SuccessPlanControllerTest: DML requires SObject or SObject list type: PortalSession__c
[Jan 1, 2026 3:14 PM]: [error] ApexClass SuccessPlanControllerTest: Invalid type: PortalSession__c
[Jan 1, 2026 3:14 PM]: [error] ApexClass SuccessPlanControllerTest: Variable does not exist: EncryptHelper
[Jan 1, 2026 3:14 PM]: [error] ApexClass SuccessPlanControllerTest: Variable does not exist: portalSession
[Jan 1, 2026 3:14 PM]: [error] ApexClass SuccessPlanControllerTest: Invalid type: PortalSession__c
[Jan 1, 2026 3:14 PM]: [error] ApexClass SuccessPlanControllerTest: Variable does not exist: EncryptHelper
[Jan 1, 2026 3:14 PM]: [error] ApexClass SuccessPlanControllerTest: Variable does not exist: portalSession
[Jan 1, 2026 3:14 PM]: [error] ApexClass SuccessPlanControllerTest: Invalid type: Objective__c
[Jan 1, 2026 3:14 PM]: [error] ApexClass SuccessPlanControllerTest: DML requires SObject or SObject list type: Objective__c
[Jan 1, 2026 3:14 PM]: [error] ApexClass SuccessPlanControllerTest: Variable does not exist: objective
[Jan 1, 2026 3:14 PM]: [error] ApexClass SuccessPlanControllerTest: Variable does not exist: objective
[Jan 1, 2026 3:14 PM]: [error] ApexClass SuccessPlanControllerTest: DML requires SObject or SObject list type: Objective__c
[Jan 1, 2026 3:14 PM]: [error] ApexClass SuccessPlanControllerTest: Variable does not exist: objective
[Jan 1, 2026 3:14 PM]: [error] ApexClass SuccessPlanControllerTest: Invalid type: PortalSession__c
[Jan 1, 2026 3:14 PM]: [error] ApexClass SuccessPlanControllerTest: Variable does not exist: EncryptHelper
[Jan 1, 2026 3:14 PM]: [error] ApexClass SuccessPlanControllerTest: Variable does not exist: portalSession
[Jan 1, 2026 3:14 PM]: [error] ApexClass SuccessPlanControllerTest: Invalid type: Objective__c
[Jan 1, 2026 3:14 PM]: [error] ApexClass SuccessPlanControllerTest: DML requires SObject or SObject list type: Objective__c
[Jan 1, 2026 3:14 PM]: [error] ApexClass SuccessPlanControllerTest: Variable does not exist: objective
[Jan 1, 2026 3:14 PM]: [error] ApexClass SuccessPlanControllerTest: Invalid type: PortalSession__c
[Jan 1, 2026 3:14 PM]: [error] ApexClass SuccessPlanControllerTest: Variable does not exist: EncryptHelper
[Jan 1, 2026 3:14 PM]: [error] ApexClass SuccessPlanControllerTest: Variable does not exist: portalSession
[Jan 1, 2026 3:14 PM]: [error] ApexClass SuccessPlanControllerTest: Invalid type: Objective__c
[Jan 1, 2026 3:14 PM]: [error] ApexClass SuccessPlanControllerTest: DML requires SObject or SObject list type: Objective__c
[Jan 1, 2026 3:14 PM]: [info] Validate Test Level: Default
[Jan 1, 2026 3:14 PM]: [error] Job failed: Salesforce metadata validation failed
```

{% endcode %}
{% 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.flosum.com/devops/code/branch-actions/using-branch-validate.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
