Beginning Salesforce DX: Versatile and Resilient Salesforce Application Development

This document was uploaded by one of our users. The uploader already confirmed that they had the permission to publish it. If you are author/publisher or own the copyright of this documents, please report to us by using this DMCA report form.

Simply click on the Download Book button.

Yes, Book downloads on Ebookily are 100% Free.

Sometimes the book is free on Amazon As well, so go ahead and hit "Search on Amazon"

Refer to the practical guidance provided in this book to develop Salesforce custom applications in a more agile, collaborative, and resilient way using Salesforce Developer Experience (DX). You will learn how to use the Salesforce Command Line Interface (CLI) to simplify working with projects, metadata, data and orgs. The CLI integrates with your development tools of choice such as Visual Studio Code, and CI/CD tools to implement DevOps pipelines. Readers will also gain an understanding of the package development model, which improves application quality and maintainability by grouping metadata into highly cohesive, loosely coupled containers. Salesforce DX supports application development throughout the entire development lifecycle where a version control system, rather than a Salesforce org, is the source of truth. It became generally available in late 2017 and has now reached a stage of feature richness and stability that it is becoming more widely adopted. Beginning Salesforce DX provides development teams with practical, how-to examples of using Salesforce DX that go beyond the Salesforce documentation. Commands and their parameters are described, including any gotchas, and the outcome of the commands on a Salesforce org is explained. What You Will Learn • How to setup a Salesforce DX development environment • Understand the key Salesforce DX concepts and the Salesforce CLI • Work with Dev Hubs, projects, orgs, metadata and version control systems • Improve quality with test users and test data • Bootstrap pro-code development with templates • Apply Salesforce DX to an end-to-end package development project Who This Book Is For Internal teams developing custom Salesforce applications for an individual customer, or those creating commercial applications for distribution via the Salesforce AppExchange enterprise marketplace. All team disciplines will benefit from understanding and applying Salesforce DX, including pro-code, low-code and no-code developers, testers, release managers, DevOps engineers and administrators. A secondary audience includes those needing to understand key concepts when establishing or evolving an organisation’s application lifecycle management capability, such as capability leaders, architects, consultants and business analysts.

Author(s): Ivan Harris
Edition: 1
Publisher: Apress
Year: 2022

Language: English
Commentary: Publisher's PDF
Pages: 568
City: New York, NY
Tags: Command Line; Packages; Testing; Version Control Systems; Metadata; Developer Tools; Salesforce

Table of Contents
About the Author
About the Technical Reviewer
Foreword
Chapter 1: Introduction
Chapter Summary
Chapter 2: Environment Setup
Installing the Salesforce CLI
Installing the Java Development Kit
Installing Visual Studio Code
Installing the Salesforce Extensions for Visual Studio Code
Chapter Summary
Chapter 3: Concepts Overview
Salesforce CLI
Visual Studio Code
Salesforce DX Projects
Source Format Metadata
Scratch Orgs
Unlocked and 2GP Packages
Dev Hub
Namespaces
Chapter Summary
Chapter 4: Salesforce CLI
Anatomy of a CLI Command
Command-Line Help
The sfdx Application
Controlling the CLI
Runtime Configuration Values
Listing Runtime Configuration Values
Setting a Runtime Configuration Value
Reading Runtime Configuration Values
Clearing a Runtime Configuration Value
Environment Variables
File Parameters
Command-Line Parameters and Arguments
JSON Formatted Command Output
CLI Logging
Salesforce CLI Command Execution
Using a Terminal Application
Using the Visual Studio Code Integrated Terminal
Using the Visual Studio Code Command Palette
Using a Visual Studio Code Context Menu
Which Command Execution Method?
Chapter Summary
Chapter 5: Dev Hub
Creating a Trial Dev Hub Org
Enabling the Dev Hub
Enable Source Tracking for Sandboxes
Enabling Unlocked Packages and Second-Generation Managed Packages
Enabling Einstein Features
Adding Salesforce DX Users
Authorizing a Dev Hub Org
Authorizing a Global Scope Dev Hub Org
Authorizing a Local Scope Dev Hub Org
Authorizing a Global and Local Scope Dev Hub Org
API Limits
Chapter Summary
Chapter 6: Projects
This Chapter’s Commands
Project Directories and Files
Creating a Salesforce DX Project
Configuring Salesforce DX Projects
Chapter Summary
Chapter 7: Orgs
This Chapter’s Commands
This Chapter’s Project
Managing Scratch Orgs
Creating Scratch Orgs
Listing Authorized Orgs and Active Scratch Orgs
Displaying Detailed Org Information
Opening Scratch Orgs
Deleting Scratch Orgs
Configuring Scratch Orgs
Scratch Org Definition File
Scratch Org Edition
Scratch Org Features and Settings
Adding Sample Data
Viewing Scratch Orgs from a Dev Hub Org
Authorizing Non-scratch Orgs
Logging In to a Non-scratch Org
Logging Out of a Non-scratch Org
Managing Sandboxes
Creating Sandboxes
Checking Sandbox Creation Status
Cloning Sandboxes
Deleting Sandboxes
Chapter Summary
Chapter 8: Metadata
This Chapter’s Commands
This Chapter’s Project
Source Format vs. Metadata API Format
Metadata Synchronization Options
Synchronizing Source Format Metadata with Source-Tracked Orgs
Pulling Source Format Metadata from Source-Tracked Orgs
Pushing Source Format Metadata to Source-Tracked Orgs
Synchronizing Source Format Metadata with Non-source-Tracked Orgs
Retrieving Source Format Metadata from Non-source-Tracked Orgs
Deploying Source Format Metadata to Non-source-Tracked Orgs
Default Test Execution
Synchronous Deployment
Asynchronous Deployment
Excluding Source Format Files from Syncing and Converting
Ignoring Source Format Files
Ignoring Metadata Components
Synchronizing Metadata API Format Metadata with Source-Tracked and Non-source-Tracked Orgs
Retrieving Metadata API Format Metadata from Source-Tracked and Non-source-Tracked Orgs
Synchronous Retrieval
Asynchronous Retrieval
Deploying Metadata API Format Metadata to Source-Tracked and Non-source-Tracked Orgs
Synchronous Deployment
Asynchronous Deployment
Converting Between Metadata API Format and Source Format
Converting from Source Format to Metadata API Format
Converting from Metadata API Format to Source Format
Chapter Summary
Chapter 9: Version Control
Git, GitHub, and GitHub Desktop
Creating a GitHub Account
Installing Git
Setting Up Your Git Identity
Installing GitHub Desktop
Working with a New Salesforce DX Project
Creating a Remote GitHub Repository
This Chapter’s Project
Creating a Local Repository
The .gitignore File
Performing the Initial Add and Commit
Changing the Branch Name
Linking a Local and Hosted Remote Repository
Synchronizing Tracked Changes
Working with an Existing Salesforce DX Project
Example Git Workflow
Creating a Local Feature Branch
Creating a Lightning Web Component
Testing the Component in a Scratch Org
Adding the Component to the Git Staging Area
Committing the Component Changes
Pushing Changes from the Local to the Remote Repository
Creating a Pull Request
Merging Changes
Chapter Summary
Chapter 10: Test Users
This Chapter’s Commands
This Chapter’s Project
Creating Scratch Org Users
Assigning Permission Sets to Users
Generating User Passwords
Chapter Summary
Chapter 11: Test Data
This Chapter’s Commands
This Chapter’s Project
Executing SOQL Queries
Record CRUD Commands
Creating Records
Reading Records
Updating Records
Deleting Records
Bulk Data Commands
Bulk Upserting
Bulk Deleting
SObject Tree Commands
Creating Hierarchical Test Data
Export Command SOQL Queries
Exporting Without a Plan Definition File
Importing Without a Plan Definition File
Exporting with a Plan Definition File
Importing with a Plan Definition File
Chapter Summary
Chapter 12: Development
This Chapter’s Commands
This Chapter’s Project
Working with Apex Classes
Executing Anonymous Apex
Creating Apex Classes
Creating Apex Triggers
Accessing Debug Logs
Running Apex Tests
Working with Custom Metadata Types
Creating a Custom Metadata Type
Adding Custom Metadata Type Fields
Creating Custom Metadata Type Records
Working with Experience Cloud Sites
Adding Experience Cloud to a Scratch Org
Listing Experience Cloud Site Templates
Creating an Experience Cloud Site
Publishing an Experience Cloud Site
Working with Lightning Web Components
Creating a Lightning Web Component
Testing a Lightning Web Component
Running Jest Tests in Debug Mode
Running Jest Tests in Watch Mode
Working with Static Resources
Working with Visualforce
Creating a Visualforce Component
Creating a Visualforce Page
Chapter Summary
Untitled
Chapter 13: Package Development
This Chapter’s Commands
This Chapter’s Project
Prerequisites
Creating the Salesforce DX Project
Namespaces
Creating a Namespace Org
Registering a Namespace
Namespace Linking
Namespaced Scratch Orgs
Deployment Options
Application Development Models
Package Development Walk-Through
Package Directories
Creating Packages
Listing Packages
Updating Packages
Establishing Package Dependencies
Defining Package Ancestry
Creating Package Versions
Listing Package Version Creation Requests
Listing Package Versions
Displaying Package Version Details
Updating Package Versions
Installing the Package Versions
Listing Installed Package Versions
Promoting Package Versions
Uninstalling Package Versions
Deleting Packages and Package Versions
Chapter Summary
Book Summary and Resources
Trailblazer Community
Salesforce Events
Salesforce DX Product
Noteworthy Developments
Index