Build Collaboratively, Deliver Continuously and Innovate Faster with Salesforce DX Benefits

Salesforce DX Benefits

Salesforce DX Benefits – Salesforce Developer Experience (DX) is a brand new way to develop and manage apps on the Lightning Platform across the entire life cycle. It combines the best of the Lightning Platform to enable source-driven development, team collaboration with governance, and new levels of agility for custom app development on Salesforce. It facilitates automated testing, continuous integration and improves agility and efficiency of the release cycle. Salesforce DX benefits are much more than just a new set of tools. They serve as an alternative to change set development and shifts the source of truth from Org to Version Control System (VCS). It shifts our development focus from org development to package development and more.

Take a sneak peek into this comprehensive blog encapsulating the Salesforce DX benefits and its significant aspects including the Developer Hub, Salesforce CLI, Scratch Orgs, Metadata Format among many others.

Salesforce DX Benefits – Developer Hub (Dev Hub) orgs

Developer Hub (Dev Hub) is the key Salesforce org that you and your team can use to create and manage scratch orgs.

Here’s how to Enable Dev Hub in your Org.

Alternatively, you can even Get your own 30-day Dev Hub Trial Org here

The Salesforce CLI

One of the key Salesforce DX benefits is the Salesforce CLI, which is used to control the full application lifecycle of the Salesforce apps. With Salesforce CLI, you can slickly create environments for development and testing, synchronize source code between your orgs and VCS, and execute tests. Here’s how to install the Salesforce CLI

  1. Enable Dev Hub in Your Org. Here’s a quick guide to enabling Dev Hub in your Org. Alternatively, you can Get your own 30-day Dev Hub Trial Org here
  2. Add Salesforce DX Users
  3. Install Salesforce CLI. Ensure that you have the latest version of the Salesforce CLI installed and the system meets the necessary requirements. Get the latest version of Salesforce CLI here                              

Salesforce DX Benefits

Verify Salesforce CLI Installation

  • Run the command below to verify the Salesforce CLI version

sfdx –version

sfdx-cli/6.0.10-3713d7b alpha (darwin-x64) node-v8.6.0

  • Run the command below to verify the Salesforce CLI plug-in version

sfdx plugins –core                                                        

salesforcedx 41.2.0 (core)                      

To learn more about Salesforce CLI installation, see the Salesforce DX Setup Guide.

Salesforce DX Benefits – Scratch Orgs

Scratch org is a fully dedicated, configurable, and short-term Salesforce environment. Scratch orgs enable developer productivity and collaboration during the development process and facilitate automated testing and continuous integration. You can spin up a new scratch org when you want to start a new project or a new feature branch, test a new feature, start automated testing or directly perform development tasks in an org.

Though scratch orgs are meant to be disposable, the scratch org configuration files contain the real brawn. Through the configuration file, you can configure the scratch org with different Salesforce editions and with just the features and settings you want. And you can share the scratch org configuration file with other team members. That way, you will all have the same basic org in which you can develop.

  • Scratch orgs are not replace Sandboxes
  • Scratch orgs aren’t meant to be replications of sandboxes or production orgs
  • A Dev Hub provides us the ability to create and manage scratch orgs.
  • Scratch orgs are temporary Salesforce environments where we can do the bulk of development work in this new source-driven development paradigm.
  • We can use the CLI or Salesforce Extensions for VS Code to open our scratch org in a browser without logging in

A new Metadata Format

In Ant and the Force.com migration tool, the APIs used by Salesforce DX are the same whereas,  in Force.com, migration tool will know that the structure of metadata returned by those APIs isn’t ideal for working from version control system. In general custom objects and profiles can cause these issues –

  • Make working with large XML files difficult
  • Multiple users making changes to the same files could create conflicts and failing to resolve these effectively can yield corrupt XML
  • These items contain a variety of changes pertaining to different features in active development in a specific org – this means when pushing changes, developers need to edit these XML files manually to incorporate only the specific changes they want to push in deployment or commit.

To overcome this, Salesforce DX uses a slightly modified folder structure that breaks up some of the larger, more complex metadata into subcomponents, providing a good workaround to these problems. It’s worth noting, however, that because it uses the same underlying APIs there are still problems this mechanism doesn’t address. It also comes with the added benefit of loosening some of the restrictions on folder structure, allowing you to introduce subfolders to organize your Apex classes.

Visual Studio Code Plugins

Visual Studio Code is a powerful editor. It is highly customizable and is cross-platform. Salesforce extensions provide unique features such as code completion, syntax highlighting, Apex live debugging, and more for the Lightning Platform.

Salesforce has already mentioned that the Salesforce Extensions for VS Code are the future of Salesforce development. They have dedicated their resources to make this the best and most enjoyable desktop editor for Salesforce developers. With this focus on Visual Studio Code, Salesforce is moving away from our support of Eclipse. While the Force.com IDE will be supported and will receive some updates in the near future, the updates will focus mainly on compatibility (and of course, security if needed). Salesforce will not be adding any new major features to the Force.com IDE and we will eventually deprecate it entirely.

How to Install Visual Studio Code?

    1. Download and install the Latest version of Visual Studio Code. (Skip, if already installed.)Salesforce DX Benefits
    2. Install it

How to Install Salesforce Extension Package?

With Salesforce Extensions for Visual Studio (VS) Code, we get a powerful integrated development environment that’s created particularly for custom development on the Lightning Platform. Here’s how to install the Salesforce Extension package

  1. Launch Visual Studio Code
  2. On the left toolbar, click the Extensions icon (the last icon down).
    Salesforce DX Benefits
  3. Search for “Salesforce Extension Pack”.
  4. Install the extension pack
  5. Click the “Reload” button to re-launch VS Code

Salesforce DX Benefits – Second Generation Packaging (2GP)

Second-generation packaging (2GP) allows customers and system integrators to create packages in a source-driven development environment. You can create and deploy packages in your own Salesforce org or develop and distribute packages to your customers. You can use packaging to take advantage of these unique features.

  • The Salesforce CLI provides commands for the entire application lifecycle so you can work efficiently with your packages, scratch orgs, and development processes
  • Options for enterprise customers to organize and deploy metadata to production orgs
  • Multiple packages per namespace, so you can better organize your source and easily share Apex code. You can use public Apex classes across packages rather than global Apex classes
  • Feature branch development and testing
  • Completely API-driven functionality
  • Packages that are built directly from the source
  • Ease of development and distribution of dependent packages

Limitations

  • Unable to Specify a Patch Version

Description: The four-part package edition number includes a patch segment, known as major.minor.patch.build. However, you cannot create a patch for a second-generation package. Package creation fails if you set a patch number in the package descriptor. Stay tuned for patch versions in an upcoming release.

Workaround: Always set the patch segment of the version number, to 0. For example, 1.2.0.1 is valid but 1.2.1.1 is not.

  • Protected Custom Metadata and Custom Settings are Visible to Developers in a Scratch Org If Installed Packages Share a Namespace

Description: Use caution when you store secrets in your second-generation packages using protected custom metadata or protected custom settings. You can create multiple second-generation packages with the same namespace. However, when you install these packages in a scratch org, these secrets are visible to any of your developers that are working in a scratch org with a shared namespace. In the future, we might add a “package-protected” keyword to prevent access to package secrets in these situations.

Workaround: None.

Source: https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_dev2gp.htm

Dependency API

Salesforce DC provides the flexible and powerful Salesforce Command Line Interface (CLI) where we can use CLI to manage package development process from the command line.

The CLI combines capabilities from across several Salesforce APIs, such as Metadata API, Tooling API, and Data (SOAP) API. It also supports the functionality of Ant Migration Tool that allows for scripting of metadata tasks. With the new and improved CLI, all our development tasks from all the important APIs are available in one place. We can script everything from the creation of orgs to the import and export of data–everything required to manage the complete development lifecycle.

To learn more about leveraging the power of Salesforce DX benefits in your organization, Talk to our team!

Recent Post

Salesforce Marketing Cloud March 2020 Features

Market your brand like a Superstar with New Salesforce Marketing Cloud March 2020 Features 

For all Salesforce lovers, New Year celebrations begin only when Salesforce release their product updates. So, it is Happy New Year for us all as Salesforce is back with hot

Salesforce Engage

Salesforce Engage | Propel Customer Engagement with Relevancy

Marketing without customer engagement is nothing more than an on-air commercial that nobody wants to see. Every day the competition is intensifying, and keeping customers engaged to a single brand is

Salesforce Einstein Language

Empower your Sales and Services with Salesforce Einstein Language

Language is a unique skill. In the hands of a suave sales guy, mastery in language can be the difference between winning or losing a customer. In customer service, language

Salesforce Evergreen

Salesforce Evergreen | Scale up your cloud productivity with ease

The trend of Cloud-based services has forever changed the way we develop and deploy applications in the server. In spite of all the benefits that the Salesforce Platform has made

Salesforce Shield

Enhance your cloud security with Salesforce Shield

Ever since Cloud came into play, Data security is the buzzword that reverberates all over the corporate world.  It has been proven time and again that data security in Cloud

Salesforce Inspector Features

Boost productivity with the Salesforce Inspector Chrome Extension

With digitization, the workload in every organization is growing exponentially, creating a lot of mundane, but essential tasks. These activities are time-consuming and not so productive to start with, but

Sales Cloud Spring ’20 Features

Build a strong and powerful community and go beyond your dreams

Over the last few weeks, we had relished bringing out the outstanding features of Sales Cloud and Service Cloud that will be released in Spring ‘20. Sales, Service, and Community have

Salesforce Service Cloud Spring '20 features

Refine your Customer Care with Salesforce Service Cloud Spring ’20 features

A business grows and prospers when its customers are happy and have no reason to complain. The Salesforce Service Cloud Spring '20 features help your Customer service reps to face

Salesforce Sales Cloud Spring '20 Features

Reimagine your Sales with new Sales Cloud Spring ‘20 Features

Salesforce has always packed loads of pleasant surprises in their Sales Cloud Spring Releases, and as is the norm, it happened this year too. This edition is focused on delivering

Salesforce Duplicate Management

Salesforce Duplicate Management | The key to cut down the roots of duplicity

Duplicity is the bane of any database.  On average, 40- 50% of a company’s data has duplicate copies spread all across the organization. These copies on a collective scale cause

Leave a Reply

Your email address will not be published. Required fields are marked *