Disable (Rehearsal tool)
Use the dxrt operation to disable Salesforce components. It invokes the metadata file-based retrieve API. The Disable process downloads the files, updates the current status to inactive, then zips and uploads them to the Salesforce instance. It can be used to download metadata files without disabling any components.
Access help
MacOSX or Linux
./dxrt salesforce disable --help
Windows
.\dxrt.exe salesforce disable --help
Syntax
MacOSX or Linux
.\dxrt.exe salesforce disable --help
Windows
.\dxrt.exe salesforce disable --parameter-name value
Parameters
The parameters for the disable operation are as follows.
Required parameters are marked with a *.
Parameter |
Description |
---|---|
*-a, –-auth_type |
Authentication mechanism used |
*-u, –username |
Salesforce username for Auth Type USERPASS |
*-ci, –-client_id |
Salesforce client id for Auth Type OAUTH |
*-ur, –-url |
Url of the salesforce sandbox for Auth Type OAUTH |
-i, –-is_production |
Specify flag is_production, if you are trying to connect to a production environment. |
-c, –component |
Comma separted list of metadata package types to retrieve and deploy. |
-f, –force |
Ignore errors while deploying. (Works only with Sandbox and not with the Production instance of Salesforce) |
-o, –sf_objects |
Comma separated Salesforce table names. |
-it, --is_interactive |
This flag needs to be provided if the user intends to provide the password/secret keys in the interactive manner via prompt. |
-e, --env_vars |
Here, User needs to provide the list of environment variable names. In case of authentication type being ‘USERPASS', user needs to pass Password & Security token here. These can be passed as ‘dxrt_password,dxrt_security_token’. In case of authentication type being ‘OAUTH’, user needs to pass client_secret, access_token, refresh_token. These can be passed as 'dxrt_client_secret,dxrt_refresh_token,dxrt_access_token’. Please note that the name of the environment variables provided above are only for reference. User can provide different names as well. However the sequence in which the variables are provided should be kept same as above. |
There are two ways in which password/secret tokens can be provided to the disable command:-
1. Using interactive mode:
Here, The disable command prompts user to enter credentials for each type of Authentication (USERPASS and OAUTH). User can use this mode by passing “-it” option in the dxrt command, With this:
-
User will be required to enter a password and security token for Authentication type USERPASS.
-
Entering client secret, refresh token and access token for Authentication Type OAUTH.
Below is a description of the fields:
Prompted Parameters |
Description |
---|---|
Password: |
Prompt for Salesforce user’s password for auth_type=USERPASS After the user enters the password, there will be a confirmation prompt to enter the same password as before. |
Security Token: |
Prompt for Salesforce user’s security token for auth_type=USERPASS |
Client Secret: |
Prompt for Salesforce client secret for auth_type=OAUTH |
Access Token: |
Prompt for Salesforce access token for auth_type=OAUTH |
Refresh Token: |
Prompt for Salesforce refresh token for auth_type=OAUTH |
2. Using Environment Variables:
When using this option, the user must provide the required security tokens and password through the use of the -e option in the dxrt disable command. The user can save the value of these parameters with any name. It is not possible to alter the order in which these parameters must be passed, though. The user can pass these settings in the disable command as shown below:
-
-e dxrt_password,dxrt_security_token for authentication type USERPASS
-
-e dxrt_client_secret, dxrt_refresh_token, dxrt_access_token for authentication type OAUTH
Please be aware that the dxrt command may change the names of the environment variables. The variables should remain in the same order, though.
Setting up the environment variables for dxrt:
For instructions on configuring the environment variables for the various platforms that DxRT is compatible with, please click here.
Sample disable Command using input parameters Username and Authentication mechanism USERPASS
Using interactive mode (-it):
The following command will prompt the user to enter their password and security token.
MacOSX or Linux
./dxrt salesforce disable -u <username@abc.com> -a USERPASS -o "Account,Contact" -it
Windows
.\dxrt.exe salesforce disable -u <username@abc.com> -a USERPASS -o "Account,Contact" -it
Using environment variables (-e):
MacOSX or Linux
./dxrt salesforce disable -u <username@abc.com> -a USERPASS -o "Account,Contact" -e 'dxrt_password,dxrt_security_token'
Windows
.\dxrt.exe salesforce disable -u <username@abc.com> -a USERPASS -o "Account,Contact" -e 'dxrt_password,dxrt_security_token'
Sample disable command using Authentication mechanism OAuth
The following command will prompt the user to enter the Client Secret, Access Token, and Refresh Token.
Using interactive mode (-it):
MacOSX or Linux
./dxrt salesforce disable -ci <client_id> -a OAUTH -ur <url> -it
Windows
.\dxrt.exe salesforce disable -ci <client_id> -a OAUTH -ur <url> -it
Using environment variables (-e):
MacOSX or Linux
./dxrt salesforce disable -ci <client_id> -a OAUTH -ur <url> -e 'dxrt_client_secret,dxrt_refresh_token,dxrt_access_token'
Windows
.\dxrt.exe salesforce disable -ci <client_id> -a OAUTH -ur <url> -e 'dxrt_client_secret,dxrt_refresh_token,dxrt_access_token'