1.1.65 • Published 4 years ago

datapacks v1.1.65

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

DataPacks : Salesforce CLI Datapacks Plugin

Created by Keeton Martin, last modified on Jun 24, 2020


Getting Started {#SalesforceCLIDatapacksPlugin-GettingStarted}

  1. Install SFDX CLI if you haven’t done so before

  2. Clone the Bitbucket repository to your local machine

  3. Link the cloned plugin with sfdx:

    sfdx plugins:link <clonedRepo>
  4. Navigate to your project folder (containing your org)

  5. Set your org username (and alias, if you want to):

    sfdx force:config:set defaultusername=me@my.org
  6. To see if the plugin is working, try

    sfdx datapacks:list

npm.ioInstalling with the sfdx plugins installer is not supported yet

This command will hopefully be supported eventually

$ sfdx plugins:install 

Basic Usage {#SalesforceCLIDatapacksPlugin-BasicUsage}

$ sfdx datapacks
$ sfdx datapacks --help

npm.ioDemoing use of some commands

This is an example terminal where different commands are used, showing example output.

➜  demoExports sfdx datapacks:types
sfdx datapacks:list -k Pricebook2
sfdx datapacks:retrieve -k Pricebook2
sfdx datapacks:deploy -k VqMachine,Pricebook2 -u myDemo

Targeting this org: cmt_test@vbt.com
Loading list of exportable DataPack types...
Your org contains 37 different types of datapacks: 

AttributeCategory           CalculationMatrix           CalculationProcedure     CpqConfigurationSetup   CustomFieldMap                   
DataRaptor                  IntegrationProcedure        IntegrationRetryPolicy   InterfaceImplementation ItemImplementation               
ManualQueue                 ObjectClass                 ObjectLayout             OmniScript              OrchestrationDependencyDefinition
OrchestrationItemDefinition OrchestrationPlanDefinition PriceList                Pricebook2              PricingPlan                      
PricingVariable             Product2                    StoryObjectConfiguration System                  UIFacet                          
UISection                   VlocityAction               VlocityAttachment        VlocityCard             VlocityPicklist                  
VlocityScheduledJob         VlocitySearchWidgetSetup    VlocityStateModel        VlocityUILayout         VlocityUITemplate                
VqMachine                   VqResource                 

Targeting this org: cmt_test@vbt.com
Keys: Pricebook2
Loading table of exportable DataPacks...
┌─────────────────────┬─────────────────────────────┬────────────────────┬────────────────────────────────┐
│ VlocityDataPackType │ VlocityDataPackDisplayLabel │ Id                 │ VlocityDataPackKey             │
├─────────────────────┼─────────────────────────────┼────────────────────┼────────────────────────────────┤
│ Pricebook2          │ B2C - Mobile                │ 01s6g000005YhDAAA0 │ Pricebook2/B2C - Mobile        │
├─────────────────────┼─────────────────────────────┼────────────────────┼────────────────────────────────┤
│ Pricebook2          │ Standard Price Book         │ 01s6g000002gIoGAAU │ Pricebook2/Standard Price Book │
└─────────────────────┴─────────────────────────────┴────────────────────┴────────────────────────────────┘
Those are all the exportable Pricebook2 in cmt_test@vbt.com
Expansion Path: datapacks
Targeting this org: cmt_test@vbt.com

Retrievals Attempted: 
┌─────────────────────┬─────────────────────────────┬────────────────────────────────┐
│ VlocityDataPackType │ VlocityDataPackDisplayLabel │ VlocityDataPackKey             │
├─────────────────────┼─────────────────────────────┼────────────────────────────────┤
│ Pricebook2          │ B2C - Mobile                │ Pricebook2/B2C - Mobile        │
├─────────────────────┼─────────────────────────────┼────────────────────────────────┤
│ Pricebook2          │ Standard Price Book         │ Pricebook2/Standard Price Book │
└─────────────────────┴─────────────────────────────┴────────────────────────────────┘
Export action terminated with status success

Targeting this org: industrydemo@vlocity.com

Deployments Attempted: 
┌─────────────────────┬───────────────────────────────────────────────────────┬────────────────────┬────────────────────────────────┐
│ VlocityDataPackType │ VlocityDataPackDisplayLabel                           │ Id                 │ VlocityDataPackKey             │
├─────────────────────┼───────────────────────────────────────────────────────┼────────────────────┼────────────────────────────────┤
│ Pricebook2          │ B2C - Mobile (Pricebook2/B2C - Mobile)                │ 01s4S000000WWAQQA4 │ Pricebook2/B2C - Mobile        │
├─────────────────────┼───────────────────────────────────────────────────────┼────────────────────┼────────────────────────────────┤
│ Pricebook2          │ Standard Price Book (Pricebook2/Standard Price Boo... │ 01s4S000000W4uCQAS │ Pricebook2/Standard Price Book │
├─────────────────────┼───────────────────────────────────────────────────────┼────────────────────┼────────────────────────────────┤
│ VqMachine           │ Testmachine (VqMachine/Testmachine)                   │ a3z4S0000004Nt9QAE │ VqMachine/Testmachine          │
└─────────────────────┴───────────────────────────────────────────────────────┴────────────────────┴────────────────────────────────┘
Deploy action terminated with status success

Implementation Progress {#SalesforceCLIDatapacksPlugin-ImplementationProgress}

Features Implemented

$ sfdx datapacks:list
$ sfdx datapacks:retrieve
sfdx datapacks:config:list
sfdx datapacks:config:set
sfdx datapacks:deploy
sfdx datapacks:types

Features in progress

Features coming soon

sfdx datapacks:diff

Command Documentation {#SalesforceCLIDatapacksPlugin-CommandDocumentation}

Config {#SalesforceCLIDatapacksPlugin-Config}

List {#SalesforceCLIDatapacksPlugin-List}

sfdx datapacks:config:list

This command shows the config options and their current values

Example:

➜  <yourOrgDirectory> sfdx datapacks:config:list
Config:

 Option         Value      
 ────────────── ──────────
 expansionPath  datapacks  

This command will create a config file if one does not already exist in <yourOrgDirectory>. It will print out all the options in the config file and their current values. Currently, the only config option supported is expansionPath.

Set {#SalesforceCLIDatapacksPlugin-Set}

sfdx datapacks:config:set

This command allows updating the value of a config option

Example:

➜  <yourOrgDirectory> sfdx datapacks:config:set expansionPath=DataPacks
Setting expansionPath to DataPacks

This command will create a config file if one does not already exist in <yourOrgDirectory>. It requires that you pass an option=value pair as an argument. The option must be from the supported list. Currently, the only config option supported is expansionPath.

expansionPath {#SalesforceCLIDatapacksPlugin-expansionPath}

expansionPath is a path from your current directory (which should always be <yourOrgDirectory>) to where you are keeping datapacks that have been retrieved from your org. Furthermore, the deploy command deploys from the expansionPath. By default, expansionPath will be set to datapacks.

Types {#SalesforceCLIDatapacksPlugin-Types}

sfdx datapacks:types

This command shows a list of the different types of datapacks that are are currently in the target org.

Using the -u flag with a value is the same as doing --targetusername=value in the Salesforce CLI. If no --targetusername is specified, the default org is targeted.

Example:

➜  <yourOrgDirectory> sfdx datapacks:types --targetusername=myDemo
Targeting this org: industrydemo@vlocity.com
Loading list of exportable DataPack types...
Your org contains 44 different types of datapacks: 

AttributeCategory           CalculationMatrix           CalculationProcedure  Catalog              ContextDimension                 
ContextScope                ContractType                CpqConfigurationSetup CustomFieldMap       DataRaptor                       
DocumentClause              DocumentTemplate            EntityFilter          IntegrationProcedure InterfaceImplementation          
ItemImplementation          ObjectClass                 ObjectLayout          OmniScript           OrchestrationDependencyDefinition
OrchestrationItemDefinition OrchestrationPlanDefinition PriceList             Pricebook2           PricingPlan                      
PricingVariable             Product2                    Promotion             Rule                 StoryObjectConfiguration         
System                      TimePlan                    TimePolicy            UIFacet              UISection                        
VlocityAction               VlocityAttachment           VlocityCard           VlocityPicklist      VlocitySearchWidgetSetup         
VlocityStateModel           VlocityUILayout             VlocityUITemplate     VqMachine           

List {#SalesforceCLIDatapacksPlugin-List.1}

sfdx datapacks:list

This command shows a list of all datapacks in the target org. It also supports filtering by datapack type using the --keys flag.

Example:

➜  <yourOrgDirectory> sfdx datapacks:list -k Product2
Targeting this org: cmt_test@vbt.com
Keys: Product2
Loading table of exportable DataPacks...

Datapacks: 

 VlocityDataPackType  VlocityDataPackDisplayLabel                            Id                  VlocityDataPackKey                             
 ──────────────────── ────────────────────────────────────────────────────── ─────────────────── ──────────────────────────────────────────────
 Product2             Apple Watch Sport Series 3 (VLO-MOB-0029 / 1b1b6c6...  01t6g000000Nf90AAC  Product2/1b1b6c6f-c1b0-1c1d-e068-4651202cb07b  
 Product2             iPhone 8 (VLO-MOB-0156 / 36643765-b8ca-7d93-7273-f...  01t6g000000Nf91AAC  Product2/36643765-b8ca-7d93-7273-fd659ff19d2d  
 Product2             Apple AirPods (VLO-MOB-0148 / 6e28982d-57c8-5bd3-e...  01t6g000000Nf92AAC  Product2/6e28982d-57c8-5bd3-e6db-d66c02c20e43  
 Product2             iPhone XS Max (VLO-MOB-0925 / ac9ff22a-24a6-b87c-8...  01t6g000000Nf93AAC  Product2/ac9ff22a-24a6-b87c-87a5-e25f223c7054  
 Product2             iPhone X (VLO-MOB-0161 / b008bfc1-b593-cbc0-f37a-7...  01t6g000000Nf94AAC  Product2/b008bfc1-b593-cbc0-f37a-76ac36296388  
 Product2             iPhone 5s (VLO-MOB-0004 / 536a3b93-0231-a411-48e1-...  01t6g000000Nf9AAAS  Product2/536a3b93-0231-a411-48e1-11960a4eff39  
 Product2             iPhone 6s Plus (VLO-MOB-0002 / 7e0b4fa5-4290-d439-...  01t6g000000Nf9BAAS  Product2/7e0b4fa5-4290-d439-ba96-f1a1c3708b0b  
 Product2             iPhone 6s (VLO-MOB-0001 / 9a86f5d9-2e05-ef0d-3492-...  01t6g000000Nf9CAAS  Product2/9a86f5d9-2e05-ef0d-3492-3479db233ef8  
 Product2             iPhone 7 (VLO-MOB-0145 / a6dd9919-a674-db93-787c-8...  01t6g000000Nf9DAAS  Product2/a6dd9919-a674-db93-787c-839fb4c1adb3  
 Product2             iPhone 8 Plus (VLO-MOB-0157 / b5625adb-4e38-93be-a...  01t6g000000Nf9EAAS  Product2/b5625adb-4e38-93be-acff-79dc7c6344bf  
 Product2             iPhone 5c (VLO-MOB-0005 / cf5caa5f-5474-3cc1-d99a-...  01t6g000000Nf9FAAS  Product2/cf5caa5f-5474-3cc1-d99a-871e62efd346  
 Product2             iPhone SE (VLO-MOB-0003 / e72f9306-388f-3335-eaaf-...  01t6g000000Nf9GAAS  Product2/e72f9306-388f-3335-eaaf-f9650202eb64  
 Product2             datapackstest (datapackstest / datapackstest)          01t6g000000OQaKAAW  Product2/datapackstest                         
 Product2             RulesProduct (RulesProduct / 0ea78a3e-6f13-a2be-36...  01t6g000000P8blAAC  Product2/0ea78a3e-6f13-a2be-362a-e8eae1a6e53b
 

Those are all the exportable Product2 in cmt_test@vbt.com

Supported Flags:

Short Name

Long Name

Functionality

-k

--keys=

Allows passing in a list of comma separated (no spaces) datapack types. Only these types of datapacks will be listed.

-s

--simple

If this flag is used, the datapack key column is the only column.

-u

--targetusername

specifies the target org

Retrieve {#SalesforceCLIDatapacksPlugin-Retrieve}

sfdx datapacks:retrieve

This command exports datapacks from the org and saves them locally to your expansionPath directory.

Example:

➜  <yourOrgDirectory> sfdx datapacks:retrieve -k Product2 -X
Targeting this org: cmt_test@vbt.com

Retrieve Status: 

 Type      Key                                            Status   
 ───────── ────────────────────────────────────────────── ────────
 Product2  Product2/datapackstest                         Success  
 Product2  Product2/0ea78a3e-6f13-a2be-362a-e8eae1a6e53b  Success  
 Product2  Product2/ac9ff22a-24a6-b87c-87a5-e25f223c7054  Success  
 Product2  Product2/1b1b6c6f-c1b0-1c1d-e068-4651202cb07b  Success  
 Product2  Product2/e72f9306-388f-3335-eaaf-f9650202eb64  Success  
 Product2  Product2/9a86f5d9-2e05-ef0d-3492-3479db233ef8  Success  
 Product2  Product2/b5625adb-4e38-93be-acff-79dc7c6344bf  Success  
 Product2  Product2/cf5caa5f-5474-3cc1-d99a-871e62efd346  Success  
 Product2  Product2/a6dd9919-a674-db93-787c-839fb4c1adb3  Success  
 Product2  Product2/36643765-b8ca-7d93-7273-fd659ff19d2d  Success  
 Product2  Product2/6e28982d-57c8-5bd3-e6db-d66c02c20e43  Success  
 Product2  Product2/b008bfc1-b593-cbc0-f37a-76ac36296388  Success  
 Product2  Product2/7e0b4fa5-4290-d439-ba96-f1a1c3708b0b  Success  
 Product2  Product2/536a3b93-0231-a411-48e1-11960a4eff39  Success  


Retrieve action terminated with status success

Supported Flags:

Short Name

Long Name

Functionality

-k

--keys=

Allows passing in a list of comma separated (no spaces) datapack types. Only these types of datapacks will be retrieved.

-a

--all

If this flag is included, all datapacks will be exported form the target org.

-X

--excludedependencies

By defualt, dependencies are exported with their requested datapacks. If this flag is used, dependencies of requested datapacks will not be retrieved.

-l

--logging

allows for progress tracking of the retrieval by enabling logging of messages from the retrieval system.

-u

--targetusername

specifies the target org

Deploy {#SalesforceCLIDatapacksPlugin-Deploy}

sfdx datapacks:deploy

This command deploys datapacks from your expansionPath directory to the target org

Example:

➜  <yourOrgDirectory> sfdx datapacks:deploy -k Product2 -X 
Targeting this org: cmt_test@vbt.com

Deploy Status: 

 Type      Key                                            Status   
 ───────── ────────────────────────────────────────────── ────────
 Product2  Product2/0ea78a3e-6f13-a2be-362a-e8eae1a6e53b  Success  
 Product2  Product2/1b1b6c6f-c1b0-1c1d-e068-4651202cb07b  Success  
 Product2  Product2/36643765-b8ca-7d93-7273-fd659ff19d2d  Success  
 Product2  Product2/536a3b93-0231-a411-48e1-11960a4eff39  Success  
 Product2  Product2/6e28982d-57c8-5bd3-e6db-d66c02c20e43  Success  
 Product2  Product2/7e0b4fa5-4290-d439-ba96-f1a1c3708b0b  Success  
 Product2  Product2/9a86f5d9-2e05-ef0d-3492-3479db233ef8  Success  
 Product2  Product2/a6dd9919-a674-db93-787c-839fb4c1adb3  Success  
 Product2  Product2/ac9ff22a-24a6-b87c-87a5-e25f223c7054  Success  
 Product2  Product2/b008bfc1-b593-cbc0-f37a-76ac36296388  Success  
 Product2  Product2/b5625adb-4e38-93be-acff-79dc7c6344bf  Success  
 Product2  Product2/cf5caa5f-5474-3cc1-d99a-871e62efd346  Success  
 Product2  Product2/datapackstest                         Success  
 Product2  Product2/e72f9306-388f-3335-eaaf-f9650202eb64  Success  


Deploy action terminated with status success

Supported Flags:

Short Name

Long Name

Functionality

-k

--keys=

Allows passing in a list of comma separated (no spaces) datapack types. Only these types of datapacks will be deployed.

-a

--all

If this flag is included, all datapacks in expansionPath be deployed to the target org.

-X

--excludedependencies

This flag might not be doing anything right now for deploy

-l

--logging

allows for progress tracking of the deployment by enabling logging of messages from the deployment system.

-u

--targetusername

specifies the target org

Document generated by Confluence on Jun 24, 2020 14:50

Atlassian