Development on Salesforce DX and what are Some Common Problems to Address

development

Salesforce DX is the latest release in the Salesforce product line, which comes with a lot of new tools and a wide range of handy features to make the task of developers easier and quicker. Along with ensuring a smoother development, Salesforce DX also promise a time-saving deployment too in real-time. Let’s have an overview of some quick facts about Salesforce DX, which makes it the favorite of new-gen developers.

  • Source-driven development

With the source-drive approach, the app makers will highly benefit from an effective collaboration of technological advantages as Git. This development model applies to all aspects of the development life cycle, including code, the configuration of org, and deploying metadata to mention a few. To enable it, Salesforce allows the developers to export additional metadata and also import the files based on configuration, edition, and features.

  • Integrated development with DX

DX is offering a brand new experience to developers in building business applications. Ranging from independent developers to bigger development teams, usage of Salesforce DX will ensure a multi-layer development lifecycle to ensure high-performance agile development practice. Adding to it, Salesforce is also a highly flexible and open platform where developers can collaborate more effectively by using the tools which each one likes to work with.

  • Faster development and in-line testing

The development environment offered by Salesforce DX is highly innovative, in which Scratch orgs is one of the mightiest components. This is what enables source-driven development by providing a disposable deployment source for the developers. Scratch org can be used to run development and in-line testing to enable continuous integration.

Salesforce tools

Accessing the latest set of tools on Salesforce DX is easy. You have first to enable the Dev Hub at the setup menu. For the beginners, you can first go for a free trial for 30 days by enabling Dev Hub. While starting, you can choose among the business and production org to go with.

Salesforce DX features a mighty set of tools to help ease each phase of the development lifecycle. The primary approach of Salesforce DX development is by shifting the source of truth from org to advanced version control system. This approach will shift the actual focus of development from an org-based development to artifact-based development. With this, individual developer experience to team collaboration is improved, and it also facilitates testing automation and real-time integration. All in all, continuous development and deployment cycles are run in an agile manner by using Salesforce DX.

The top Salesforce advantages are:

  • A better individual and team development environment.
  • Easy and effective collaboration between the individual developers, tester, designers as well as the users.
  • Enables easy testing automation and integration.
  • Making the release cycles more efficient and agile.
  • Enhanced version control system, which allows better synchronization.
  • Real-time change-tracking
  • Lesser time to market and better quality development.
  • continuous integration (CI) and continuous delivery (CD)
  • More visibility and clarity for change management
  • Capability to implement agile release management.

Working of Salesforce DX

If you are new to Salesforce DX, then Trailhead is the right place to start from. Following this trail will let you go step by step to fully leverage the tools and features of Salesforce DX for optimal development experience. The key elements of Salesforce DX beginners need to know are:

  • Scratch Orgs – This enables the creation of orgs for development, which can be used as a tool for continuous development and integration.
  • Source Sync – Enabling synchronization of all the packaged resources and also metadata in the Scratch Orgs.
  • CLI – Enables better interaction with Scratch Orgs, Heroku, Source Sync, and other similar services.
  • Test Runner –This will help enhance the Salesforce ability to define the right profiles which developer have to execute.
  • Continuous Integration – The Salesforce DX ability to use the benefits of the CI processes as Travis CI, Jenkins, Heroku CI, and TeamCity, etc.
  • com – An integrated development which is new and improved.

Some common Salesforce errors beginners need to keep an eye on

Failing to import the Record Types

Some other times, you may find an error message as «Record Type not supported» while running the ‘data:tree: import’ command at Salesforce CLI. You can find the workaround for these issues at Flosum.com.

Salesforce CLI warning message

You may sometimes encounter a problem while installing the Salesforce CLI on machines running on Windows OS. You may see some warnings on the screen by the Windows Defender like the app may put your machine risk. You may ignore this warning by clicking the Run option.

Limited Windows Shell support

Even though CLI is claimed to have cleared testing for Command Prompt as well as Powershell, there are many issues noted at the Min-GW and Cygwin environments. There are also some problems noted with the Windows Subsystem for Linux (WSL). Even though these environments may get supported in future, for immediate usage, the workaround is to use a supported shell.

Failing to run the force:apex:test: run

At some situations, it is noted that the command as ‘force:apex:test: run’ may not execute properly. These situations include some Apex compilations errors or tests triggering some pre-compile as other tests are in progress. Such situations are reported largely by the CLI users and developers. The solution for this issue is to try and size the execution of the command by ‘control-C.’ If the command runs as a part of some tasks for continuous integration, you may set an ideal environment variable.

Scratch Org

Sometimes, an issue is reported as Salesforce CLI cannot recognize Scratch Orgs. Not in all cases, but in many instances there is a chance that the Salesforce CLI may not acknowledge the scratch org creation. You may see the scratch listed at the Dev Hub, but you may not be able to open it. The ideal workaround for this issue is deleting the scratch org in Dev Hub and then create a new scratch org by using the CLI. However, this deletion and creation of scratch orgs may affect the limits of scratch org creation one has.

What we discussed here are just some limitations beginners may experience while working with Salesforce DX, which have many easy fixes too. We can expect possible fixes for all these issues in the further releases of Salesforce DX.

Categorías
Tags

About Gustavo Martinez

Phd. en computación, Senior Bloguer, Amante de la tecnología móvil, aplicaciones web, educación online.

Deja una respuesta

Por favor, usa tu nombre real en vez de un nick.

Time limit is exhausted. Please reload CAPTCHA.