Import and Export Records using Salesforce DX

Using Salesforce DX to Export and Import records into regular Salesforce Instances without dependency on developer hub org

In today’s continuous integration solution built for Salesforce, if you need to load sample data into Salesforce then either we use command line dataloader or custom tool built to import export records.

With Salesforce DX, we can import and export records right from Salesforce DX. Again, if you are new to Salesforce DX, then first read this blog post to quickly understand what is Salesforce DX. 

We don’t need Developer Hub or Scratch Orgs to use Salesforce DX for import and export. In this blog post, I have used my regular developer org for demo.

First step as always, to make sure if Salesforce DX CLI is connected to your Org or not ? If its not connected then use below command to connect and give alias which is easy to remember. Continue reading “Import and Export Records using Salesforce DX”

Use Metadata API with Salesforce DX

Using old project format from ANT Migration toolkit or Force.com IDE ( package.xml ) in Salesforce DX without enabling Developer Hub

If you have existing VCS which stores metadata information about your Salesforce instance in old format, dependent on package.xml and you want to use Salesforce DX then this blog post is for you. As you might already know, Salesforce DX does not need package.xml and can automatically detect changes in your Salesforce instance, therefore new Salesforce DX project format is different. In this blog post we will see, how Salesforce DX can be used without enabling Developer Hub and using Salesforce DX with normal Salesforce instances.

There are two solution to this problem

  1. Keep using old Project format and use Metadata API to retrieve and deploy
  2. Convert old project format to Salesforce DX project Format

Continue reading “Use Metadata API with Salesforce DX”

Continuous Integration vs. Continuous Delivery vs. Continuous Deployment

Difference between Continuous Integration vs. Continuous Delivery vs. Continuous Deployment

I have written many posts about Continuous Integrations and implemented many projects with capability of Continuous Delivery. However multiple times got into discussion on what exactly is difference between Continuous Integration, Continuous Delivery and Continuous Deployment. As SFDX is new way to develop and deploy changes in Salesforce, just thought to post a small post on basic difference between these terms.

Continuous Integration

Continuous Integration is automated build scripts to detect changes in Source Code Management (SCM) like Git. Once the change is detected, source code would be deployed to common dedicated build server (Sandbox) to make sure build is not failing and all test classes and integration tests are running fine. Continue reading “Continuous Integration vs. Continuous Delivery vs. Continuous Deployment”

Continuous Integration (CI) in Salesforce using Team Foundation Server (TFS) – Video

Step by step guide to set up Continuous Integration (CI) for Salesforce using Team Foundation Server (TFS) with video tutorial

I have already written some Continuous Integration (CI) posts for Salesforce previously using different tools like Jenkins. In this blog post we will go through steps to use Microsoft Team Foundation Server (TFS) to set up Continuous Integration.

We can either use cloud based Team foundation Server (TFS) or locally installed on network. For ease, we would be using cloud based TFS for this blog post.

Step 1: Creating developer account on VisualStudio Online

Navigate to https://www.visualstudio.com/ and choose Get Started for free in Visual Studio Team Services section. You may need to create a new Microsoft developer account, if you don’t have it already.

Step 2: Using TFS as source code repository

Once we are able to login to TFS, lets start by creating a code repository. That’s right, you don’t need separate Bitbucket or Github account to save your code/metadata unlike in Jenkins. So, our start with TFS is really good and impressive till this point 🙂 . Wizard to create new project is self explanatory and would look like below image

Visual Studio Team Foundation Server - New Project Screen
Visual Studio Team Foundation Server – New Project Screen

Continue reading “Continuous Integration (CI) in Salesforce using Team Foundation Server (TFS) – Video”

Automated Code review for Apex in Salesforce – Static code analysis – Video

Using open source PMD tool to generate code quality report for Apex classes

PMD is very well known source code analyzer for Java, android and many more languages. Good news for us (Salesforce developers) is , that it supports now Apex. You might be thinking how can we make PMD as part of our daily life ?

There are multiple ways

  1. We can run static code analysis standalone
  2. It can be part of ANT build to generate error reports
  3. Jenkins can use it to generate nice report around code quality
  4. Eclipse can use it as a plugin to generate report

In this blog post, we will discuss option 1, that is running it as a standalone application to generate code quality report.

First Step is to download jar file of latest PMD distribution from here. Continue reading “Automated Code review for Apex in Salesforce – Static code analysis – Video”

Continuous Integration in Salesforce using Flosum AppExchange

Native Force.com solution for Continuous Integration using AppExchange product Flosum

This is first of many upcoming articles on evaluation of Salesforce AppExchange products. In this post we will be discussing capability of native Force.com based solution for Continuous integration. Deployment has always been one of pain point in Salesforce developement. I have worked and proposed many solutions to customers based on their requirement and budget. One of solution which got my attention recently is “Flosum” available and listed on AppExchange from this year.

I have used many traditional continuous integrations like Jenkins, Bamboo, Scheduled ANT script but all of them still involve manual intervention and most important, special skill set to setup and handle any issue arising time to time.

Let’s talk about Flosum and what makes it different at high level:

  • Complete native solution built over Force.com platform
  • Requirement gathering to deployment, all aspects covered
  • Multiple environment management
  • Easy Profile migration
  • Security access to environment for each user
  • Default space 11GB
  • Acts as Version Control
  • Supports Continuous integration and auto deployments
  • Compare Complete Org with historical or current changes
  • 360 reporting view

Continue reading “Continuous Integration in Salesforce using Flosum AppExchange”

Using CCTray to monitor continuous integration setup using Jenkins for Salesforce | Video Tutorial

In previous article, I have explained that how to use Jenkins to setup Continuous integration for Salesforce.

Now, once Jenkins is up and its doing its job to build Salesforce changes. Next task is to monitor build result. We already setup post deployment task by creating chatter message to notify everyone about build result, however there is one more excellent way to be aware about result and its small desktop client named “CCTray”.

You can download CCTray from here. Once installed, follow below steps to setup.

Open CCTray and navigate to settings :

CCTray Settings
CCTray Settings

Continue reading “Using CCTray to monitor continuous integration setup using Jenkins for Salesforce | Video Tutorial”

Continuous integration in Salesforce Using Jenkins and Git | Video Tutorial

As your Salesforce Organization undergoes heavy customization and frequent builds, moving changes from one Sandbox to other sandboxes starts taking longer time and effort. Also, in normal Salesforce project, there are chances that you will have minimum three sandboxes likely Developer Sandbox, QA Sandbox and UAT Sandbox. After some time you will be in need of some solution which can reduce your effort.

Almost 5 years back, when I was working on .net along with Salesforce, I posted article on Continuous Integration of ASP.net and subversion as a code management with MSBuild on code project.

This time its Salesforce using Jenkins. In this article I will walk through solution of above problem using Jenkins. Don’t forget to watch Video at end of this article, where I provided demo of everything explained in this article.

Prerequisite Software:

  1. ANT
  2. Salesforce Migration Tool
  3. Git
  4. Eclipse or PuTTYgen to generate SSH key

I am assuming you already know about below concepts:

  1. How to use Git with Salesforce
  2. Using ANT migration tool in Salesforce
  3. Generating SSH key
  4. Automated Daily Backup of Salesforce Using ANT Migration Tool and GIT (Optional)

I will suggest to get familiar with first three topics before jumping to Continuous Integration.

There are two ways to start working with Jenkins

  1. Install Jenkins on your local system
  2. Use Cloudbees online

Below diagram shows complete flow of Continuous Integration we are going to setup in this article.

Continuous integration in Salesforce Using Jenkins and Git
Continuous integration in Salesforce Using Jenkins and Git (Bit Bucket)

For this tutorial, I will install Jenkins on my local system. To install it, Navigate to Jenkins homepage and download installer. Continue reading “Continuous integration in Salesforce Using Jenkins and Git | Video Tutorial”