> ## Documentation Index
> Fetch the complete documentation index at: https://docs.flexagon.com/llms.txt
> Use this file to discover all available pages before exploring further.

# deploySalesforceSFDX

> Deploys a Salesforce artifact to a Salesforce Organization or sandbox using the Salesforce CLI. This plugin operation requires to be installed on the

Deploys a Salesforce artifact to a Salesforce Organization or sandbox using the Salesforce CLI. This plugin operation requires [sfdx](https://developer.salesforce.com/tools/sfdxcli) to be installed on the endpoint where the project will be executed.

Supports both Full and Package-Based Deploy projects. Deploys a FlexDeploy Salesforce zip file from the `FD_ARTIFACTS_DIR`. This file must have been created by the BuildSalesforce operation.

# Target Properties

<table><colgroup><col /><col /><col /><col /></colgroup><tbody><tr><th>**Property Name**</th><th>**Property Code**</th><th>**Required**</th><th>**Description**</th></tr><tr><td>Salesforce Account Code</td><td>`FDSF_ACCOUNT_CODE`</td><td>Yes</td><td>Salesforce Account with all the required properties like User, Password, Client Id, etc</td></tr><tr><td>Salesforce Cli Path</td><td>`FDSF_CLI_PATH`</td><td>No</td><td>The Salesforce CLI Path. (Eg: C:\Program Files\Salesforce CLI\bin)</td></tr><tr><td>Salesforce API Version</td><td>`FDSF_API_VERSION`</td><td>No</td><td>The Salesforce API version to target.Specifies the Salesforce API version to use(e.g., 64.0, 63.0)..**Since version 9.0.0.8**, This property is optional. If left blank, FlexDeploy will automatically detect and use the latest supported API version from your Salesforce Org at runtime using a REST API call - up to the maximum version supported by both your Salesforce organization and FlexDeploy.</td></tr></tbody></table>

# Cloud Account Properties

<table><colgroup><col /><col /><col /><col /></colgroup><tbody><tr><th>**Property Name**</th><th>**Property Code**</th><th>**Required**</th><th>**Description**</th></tr><tr><td>Salesforce User Email</td><td>`FDSFCA_USER`</td><td>Yes</td><td>Authentication User Email</td></tr><tr><td>Salesforce Password</td><td>`FDSFCA_PASSWORD`</td><td>No</td><td>The Salesforce password for Salesforce UserIf you are using a security token, paste the 25-digit token value to the end of your passwordIf you don't know the security token, see [[http://salesforce.stackexchange.com/questions/95259/where-is-reset-security-token-option-in-salesforce](http://salesforce.stackexchange.com/questions/95259/where-is-reset-security-token-option-in-salesforce)](http://salesforce.stackexchange.com/questions/95259/where-is-reset-security-token-option-in-salesforce)</td></tr><tr><td>JWT Key File</td><td>`FDSFCA_SERVER_KEY_FILE`</td><td>No</td><td>Path to a file containing the private key</td></tr><tr><td>Client Id</td><td>`FDSFCA_CLIENT_ID`</td><td>No</td><td>OAuth client ID (sometimes called the consumer key)</td></tr><tr><td>Client Secret</td><td>`FDSFCA_CLIENT_SECRET`</td><td>No</td><td>OAuth client secret (sometimes called the consumer secret)</td></tr><tr><td>Development Org Type</td><td>`FDSFCA_ORG_TYPE`</td><td>No</td><td>Enter Org type for Development Environment. Eg: Sandbox or DevHub or DeveloperSince 9.0.0.8 version, this property has been updated to a List data type and now accepts the following values<ul local-id="353ee84b-6172-4f0c-b6ee-4d54790a7648"><li local-id="6bfa052f-824f-4afc-9793-64517e3df87e">Production org</li><li local-id="5320e441-446a-4d3a-88e0-fd14b39a50c7">Sandbox</li><li local-id="17e41565-42fb-496b-8b1c-fd8222cbd7c6">Developer Edition</li><li local-id="5c05f087-5eb9-4697-a31d-6fb03aa452e0">Developer Edition with DevHub</li><li local-id="793e394a-c306-42da-9b90-cdc4dfd32bf6">Scratch org</li><li local-id="07068dad-1156-4cee-aec1-6565bbfacd72">Other</li></ul></td></tr><tr><td>Salesforce URL</td><td>`FDSFCA_URL`</td><td>No</td><td>The login URL of the instance the org lives on</td></tr><tr><td>Sandbox Name</td><td>`FDSFCA_SANDBOX`</td><td>No</td><td>The name of a Sandbox to access**Note **- It is required when Development Org Type is selected to Sandbox</td></tr><tr><td>Security Token</td><td>`FDSFCA_SECURITY_TOKEN`</td><td>No</td><td>Salesforce security token for Salesforce User. **Refer **Salesforce Password description.</td></tr></tbody></table>

# Inputs

<table><colgroup><col /><col /><col /><col /></colgroup><tbody><tr><th>**Input Name**</th><th>**Input Code**</th><th>**Required**</th><th>**Description**</th></tr><tr><td>Check Only</td><td>`FDSF_INP_CLI_CHECK_ONLY`</td><td>No</td><td>Check to only validate the deployment. Uncheck to complete the deployment normally.Uses the "--checkonly" parameter while executing the command.</td></tr><tr><td>Artifact Test Level</td><td>`FDSF_INP_ARTIFACT_TEST_LEVEL`</td><td>No</td><td>Test Level for current artifact/package. Overrides Test Level set for the package.Accepted values are NoTestRun, RunSpecifiedTests, RunLocalTests and, RunAllTestsInOrg.Uses the --testlevel" parameter while executing the command.</td></tr><tr><td>Artifact Tests</td><td>`FDSF_INP_ARTIFACT_TESTS`</td><td>No</td><td>Tests for current artifact/package. Overrides Tests set for the package.Only used when the Test Level input is set to RunSpecifiedTests.Uses the "--runtests" parameter while executing the command.</td></tr></tbody></table>

# Outputs

<table><colgroup><col /><col /><col /></colgroup><tbody><tr><th>**Output Name**</th><th>**Required**</th><th>**Description**</th></tr><tr><td>`FDSF_DEPLOYMENT_ID`</td><td>No</td><td>Outputs the deployment id so that it can be used in other operations or to look up the status of the deployment in the Salesforce UI</td></tr><tr><td>`FDSF_OUT_NUMBERTESTFAIL`</td><td>No</td><td>Number Test cases Fail</td></tr><tr><td>`FDSF_OUT_NUMBERTESTSUCCESS`</td><td>No</td><td>Number Test cases Success</td></tr><tr><td>`FDSF_OUT_NUMBERTESTRUN`</td><td>No</td><td>Number Test cases Run</td></tr><tr><td>`FDSF_OUT_TESTPERCENTAGE`</td><td>No</td><td>Test Percentage</td></tr><tr><td>`FDSF_OUT_CODECOVERAGEPERCENTAGE`</td><td>No</td><td>Code Coverage Percentage</td></tr></tbody></table>

# Artifacts 

This operation consumes artifacts from the artifacts repository.

# Endpoint Selection

This operation will select all available endpoints associated to the Target.

# Endpoint Execution

This operation will execute on any one of the selected endpoints and will be random in the determination of which one.
