Sunteți pe pagina 1din 20

Copado Partner Success

Training Webinars

Copado CLI & ADD


2020
INTRODUCTION

Nolan Larrabee
Sales Engineer
Dayton, OH
Training Considerations
● Questions can be submitted through this form, which will be
posted in the Pinned Post of our 2020 - Partner Success
Training Group in the Copado Success Community
● All questions will be stored in this sheet and can be revisited at
any time. That’s also where we’ll provide answers and
additional resources for you to consult.
● Our expectation is that you have completed all Exercises from
Session #5 prior to beginning Session #6
● Make sure all USs from previous session have been
synchronized and deployed to all environments in your
Pipeline
AGENDA

1. Copado CLI
a. Introduction and prereqs
b. Commands
c. Demo
d. CLI Considerations
2. Copado Advanced Data Deployer
a. Overview
b. Exercises
Introduction and prereqs

+
IntelliJ IDEA Visual Studio Code
CLI Prerequisites

● On the Copado setup side:


○ A Salesforce user with a Copado managed package license assigned.
○ A Copado org credential. The org credential needs to be authenticated with the credentials of the user in the organization where
Copado is installed.
○ A Copado license.
○ A Pipeline associated with the remote repository to which you will be pushing your changes.
○ A user story to work on.

● On the Copado CLI setup side:


○ An IDE. You can use your favourite IDE as mentioned before.
○ Salesforce CLI: You can download the Salesforce CLI from Salesforce’s site.
Auth Commands
Config Commands
Work Commands
Video/Demo

https://youtu.be/xaZ6mpwBkB0
CLI Considerations

Copado User Interface Pros

● Commit and deploy granular changes to items like profiles, permission sets, custom objects, etc.
● When merging branches, Copado will run the Autoresolve functionality to resolve any conflicts
● You can select different git operations (like recommit with re-create feature branch, or full Profiles and Permission Sets) among others.
● Destructive changes - Copado will take off updating the components that have nested items with references to the deleted component
and remove them automatically.

CLI Pros

● Minimize context switch - You don’t need to leave IDE if you heavily work with code components.
● Granular commits on code components (apex, lightning, etc.)
● Faster commit time
ADD Overview

● Moving data manually, or with Soql queries one-object-at-a-time can be both time consuming and risky.

● Additionally, maintaining cross-object relationships, record type and owner user name transformations
and scrambling/masking data is a difficult manual task.

● Copado minimizes this effort with Advanced Data Deployment Templates and Deployment Steps.

● Templates can be pre-defined and used on demand by team members with less Data Relationship or
SOQL knowledge
Preparation for Exercise 1: Deploy Data Model to UAT

IN PRODUCTION

Create External Id fields on the following objects:

● Accounts
● Contacts
● Cases

Each External Id field should be created as:


● Label: {Object Name} External Id Replace {Object Name} with each Object in turn:
● Account External Id
● Type = Text ● Contact External Id
● Length = 18 ● Case External Id
● Always Required = True
● Unique = True
● Case Sensitive = True
● External Id = True
Preparation for Exercise 1: Deploy Data Model to UAT (cont’d)

Deploy changes to UAT.


Go to the Deployments tab and create a new Deployment of type
Advanced Multi-Step with Source Org = Production and To Org =
UAT so that your Deployment record header looks like this:

Make sure to include our 3 External Id Fields (Account External Id,


Contact External Id and Case External Id) and the 6 native
Salesforce Profiles (Admin, ContractManager, MarketingProfile,
ReadOnly, SolutionManager and Standard):

Add this in the find & replace field of the deployment step:
(?s)(\n\s*<userPermissions>(?:(?!<userPermissions>).)*?<nam
e>ManageSandboxes</name>(?:(?!<userPermissions>).)*?</us
erPermissions>)

Execute the deployment!


Preparation for Exercise 2: Seed Records & Assign Licenses

We need sample data which we can move between orgs for: At the bottom of the page: Map Fields
● Account
● Contact
Then: Confirm Insert
● Case
They can be downloaded from here: For Contacts:
CSVs for Session 6
Follow the steps, but in the mapping, use:
Use Workbench to load the CSVs onto your Training Production ● Account.Account_External_Id__c as mapping for the AccountId field.
Login: https://workbench.developerforce.com/login.php?startUrl=%2Fselect.php

For Cases:
Follow the steps, but in the mapping, use:
● Account.Account_External_Id__c as mapping for the AccountId field.
● Contact.Contact_External_Id__c as mapping for the ContactId field
Use your Training Prod Credentials.
Then navigate to:
Data > Insert LICENSES:
● Set Object Type: Account/Contact/Case
● From File: > Choose File: Choose the respective CSV Step 1 - Assign the ADD license to your User.
● Next 1. Login to Production
2. Navigate to App Launcher / Copado License Manager
3. Assign the ADD License to your user
Build Template: Accounts / Contacts 1

1. Navigate to App Launcher / Data Templates tab Step 3 - Add a Filter to ensure we only Retrieve Accounts with our External Id field
2. Click on New
1. Go to the Main Object Filter subtab
a. Data Template Name: ADD-UC1 - Accounts 2. Add a Filter for Acct External Id Not Equals {Blank}
b. Template Source Org: Production (select your Org Credential for 3. There is no need to alter the Filter Logic
Production) 4. Go back to the Template Details subtab
5. Check the Active checkbox
c. Main Object: Account
6. Click Save Template
d. Leave all other fields at their default values
e. Click Save Template Step 4 - Create a Data Template for Child Object Contact
3. Go to the Object Fields subtab
The beauty of Advanced Data Deploy is that we can deploy data spanning multiple Objects. Let’s
4. Ensure the below Fields are checked:
add our Contact Template to include Contacts on our Accounts.
Account Name* Billing State- select
Replace Value and 1. Go to the Child Objects subtab
enter “TS” 2. Select the Contacts Object and create a New Template:
● Data Template Name: ADD-UC1 - Contacts
Acct External Id*- make Billing Street - select Billing Country- select ● Template Source Org: Production
sure to check Use as Scramble with Format Scramble with Format ● Main Object: Contact
External Id 3. Ensure the below Fields are checked:
Account Phone - select Billing City - select Billing Zip- select Full Name* Email Address - select Scramble Mailing State- select Replace
Scramble with Format Scramble with Format Scramble with Format with Format Value and enter “TS”
Website Contact External Id*- make sure Business Phone - select Mailing Country- select
to check Use as External Id Scramble with Format Scramble with Format
Last Name* - select Scramble Mailing Street - select Scramble Mailing Zip- select Scramble
Leave all other fields unchecked and click Save Template
with Format with Format with Format
First Name - select Scramble Mailing City - select Scramble Also: Email Opt Out and Is Email
with Format with Format Bounced

Leave all other fields unchecked and click Save Template


Build Template: Finish & Deploy

1. Go back to the ADD-UC1 - Accounts 1. Navigate to App Launcher / Deployments tab


template 2. Click on New
2. Navigate to the Child Objects subtab a. Select Data Deployment
3. Assure that the ADD-UC1 - Contacts b. Click on Start Deployment Setup
template is selected in the Contact c. Name: Deploy Accts and Contacts to UAT
relationship d. Select Production as the source
4. Click on Save Template e. Click on Confirm Source
f. Select UAT as the target
g. Click on Confirm Target
h. Select the ADD-UC1 - Accounts template
i. Click on Confirm Selection
j. Finally, click on Start Deployment
Homework - Build Template #2: Cases

Step 1 - Create the Template Header Step 3 - Go to the Parent Objects Tab of “ADD-UC2-Cases” - Create a Limited Template for
1. Navigate to App Launcher / Data Templates tab “ADD-UC2 - Case Account”
2. Click on New
1. Check the box next to Account Id and create a NEW Template
a. Data Template Name: ADD-UC2-Cases 2. Chain out to the new Template.
b. Template Source Org: Production (select your Org 3. On this Limited Account Template, you ONLY need to select the Account External Id field for
Credential for Production) this Template because we know the Accounts already exist in UAT. It is only required to link
c. Main Object: Case the accounts with the cases.
4. Make sure to flag Account External Id for Use as Ext Id and ignore all other errors on this
d. Leave all other fields at their default values Template.
e. Click Save Template 5. Check the Active checkbox
6. Click on Save Template
Step 4 - Return to the Parent Objects Tab of “ADD-UC2-Cases” - Create a Limited Template for
Step 2 - Identify the Case Fields we wish to retrieve
“ADD-UC2 - Case Contact”
1. Check the box next to Contact Id and create a NEW Template; chain out to the new
Subject* Status IsEscalated Template.
Case_External_Id__c*- Case Origin Priority 2. On this Limited Contact Template, you ONLY need to select the Contact External Id field for
make sure to check Use this Template because we know the Contacts already exist in UAT. It is only required to link
as External Id
the accounts with the cases.
Case Type Closed 3. Make sure to flag Contact External Id for Use as Ext Id and ignore all other errors on this
Template.
4. Check the Active checkbox
5. Click on Save Template
Homework - Build Template #2: Finish & Deploy

Step 5 - Go to the Filters Tab of Tab of 1. Navigate to App Launcher / Deployments tab
“ADD-UC2-Cases” 2. Click on New
1. Add a Filter to ensure we only Retrieve Cases with a. Select Data Deployment
our External Id field and ignore all other errors on this
Template. b. Click on Start Deployment Setup
2. Check the Active checkbox c. Name: Deploy Cases to UAT
3. Click on Save Template d. Select Production as the source
e. Click on Confirm Source
f. Select UAT as the target
g. Click on Confirm Target
h. Select the ADD-UC2-Cases template
i. Click on Confirm Selection
j. Finally, click on Start Deployment
THANK YOU!
Thank you so much for being a part of the Copado Ohana, for your Partnership and for your commitment to Copado Partner Training!

Nolan Larrabee
Sales Engineer
Dayton, OH

S-ar putea să vă placă și