The SFDX plugins allow developers and devops to automate tasks which are related to Duplicate Check Licenses as well as Duplicate Check configurations.
As an example, You have a build pipeline with different staging environments you can automate the installation of the DC Configuration so this is the same in all environments.
Another example; You are working with Scratch Orgs and you need to link this scratch org to your production license you can do this via the plugin.
Installation Guide
In order to work with the plugin you need to have the SFDX Cli installed. Please refer to the SFDX Guide for installation and usage.
https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_intro.htm
Installation
sfdx plugins:install plauti-sfdx
During the installation you need to accept the not signed warning as this is not possible yet for plugins within SFDX. You will receive the installation confirmation within the terminal.
Uninstall
sfdx plugins:unistall plauti-sfdx
You will receive the uninstallation confirmation within the terminal.
Configuration
The configuration pluign allows you to export and import the Duplicate Check configuration. The configiration is saved in a file or import from a file.
Export
USAGE $ sfdx plauti:duplicatecheck:config:export --file [--pollinterval ] [-u ] [--apiversion ] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL] OPTIONS -u, --targetusername=targetusername username or alias for the target org; overrides default target org --apiversion=apiversion override the api version used for api requests made by this command --file=file (required) Export file path and name --json format output as json --loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for this command invocation --pollinterval=pollinterval [default: 3] Poll interval in seconds EXAMPLES $ sfdx plauti:duplicatecheck:config:export --targetusername myOrg@example.com --file ./export/test_config.json $ sfdx plauti:duplicatecheck:config:export --targetusername myOrg@example.com --file ./export/test_config.json --pollinterval 10
Import
USAGE $ sfdx plauti:duplicatecheck:config:import --file [--pollinterval ] [-u ] [--apiversion ] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL] OPTIONS -u, --targetusername=targetusername username or alias for the target org; overrides default target org --apiversion=apiversion override the api version used for api requests made by this command --file=file (required) File path --json format output as json --loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for this command invocation --pollinterval=pollinterval [default: 3] Poll interval in seconds EXAMPLES $ sfdx plauti:duplicatecheck:config:import --targetusername myOrg@example.com --file ./export/test_config.json $ sfdx plauti:duplicatecheck:config:import --targetusername myOrg@example.com --file ./export/test_config.json --pollinterval 10
License
The license plugin lets you refresh the Duplicate Check License via SFDX.
Refresh License
USAGE $ sfdx plauti:duplicatecheck:license:refresh [-u ] [--apiversion ] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL] OPTIONS -u, --targetusername=targetusername username or alias for the target org; overrides default target org --apiversion=apiversion override the api version used for api requests made by this command --json format output as json --loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for this command invocation EXAMPLE $ sfdx plauti:duplicatecheck:license:refresh --targetusername myOrg@example.com
Sandbox Linking
The Sandbox Linking plugin lets you list, link and unlink sandoxes to your paid Duplicate Check for Salesforce license. Each paid license of Duplicate Check for Salesforce comes with a certain number of sandbox licenses. These sandboxes need to be linked to the production license in order to activate the license for a sandbox.
Link
USAGE $ sfdx plauti:duplicatecheck:sandbox:link --sandboxname [--organizationid ] [--sandboxusername ] [-u ] [--apiversion ] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL] OPTIONS -u, --targetusername=targetusername username or alias for the target org; overrides default target org This is the org where DC paid is activated. --apiversion=apiversion override the api version used for api requests made by this command --json format output as json --loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for this command invocation --organizationid=organizationid Sandbox Organization Id --sandboxname=sandboxname (required) Sandbox Name --sandboxusername=sandboxusername Sandbox User Name EXAMPLES $ sfdx plauti:duplicatecheck:sandbox:link --targetusername myOrg@example.com --organizationid 00DR0000001ossaMAA --sandboxname mysandbox $ sfdx plauti:duplicatecheck:sandbox:link --targetusername myOrg@example.com --sandboxusername scratch_org_1 --sandboxname mysandbox
Unlink
USAGE $ sfdx plauti:duplicatecheck:sandbox:unlink [--organizationid ] [--sandboxusername ] [-u ] [--apiversion ] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL] OPTIONS -u, --targetusername=targetusername username or alias for the target org; overrides default target org This is the org where DC paid is activated. --apiversion=apiversion override the api version used for api requests made by this command --json format output as json --loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for this command invocation --organizationid=organizationid Sandbox Organization Id --sandboxusername=sandboxusername Sandbox User Name EXAMPLES $ sfdx plauti:duplicatecheck:sandbox:unlink --targetusername myOrg@example.com --organizationid 00DR0000001ossaMAA $ sfdx plauti:duplicatecheck:sandbox:unlink --targetusername myOrg@example.com --sandboxusername scratch_org_1
List
USAGE $ sfdx plauti:duplicatecheck:sandbox:list [-u ] [--apiversion ] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL] OPTIONS -u, --targetusername=targetusername username or alias for the target org; overrides default target org This is the org where DC paid is activated. --apiversion=apiversion override the api version used for api requests made by this command --json format output as json --loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for this command invocation EXAMPLE $ sfdx plauti:duplicatecheck:sandbox:list --targetusername myOrg@example.com
Custom Field error when linking Sandbox license
Custom Field error when linking Sandbox license
When linking or having linked a sandbox to your Duplicate Check license, you might get an error stating
"Custom Field *** is configured in a scenario, but custom fields are not licensed."
To solve this, perform a hard license refresh in the Sandbox. Execute the following code in Developer Console > Debug > Open Execute Anonymous Window:
Database.executeBatch(new dupcheck.dc3LicenseBatch());