Using Microsoft Adaptive Cards in LWC

Adaptive Cards in Salesforce

There could be a situation in your project where UI components in your application need to be defined at run time where Salesforce may or may not have control. We can solve this situation in LWC using CSS or template:if directive.

There is another alternative to the above problem statement, which can be an extremely lightweight framework from Microsoft – Adaptive cards.

In nutshell, Adaptive cards take a JSON input and convert it to HTML UI elements. In this blog post, I would be sharing simple source code to depict how it works.

Shell Script – Read all file names in Git Pull Request

In your CI / CD process, it could be very common scenario that you need to know name of all files thats part of any pull request. Example- in Salesforce you want to perform delta deployment with only components that are part of user story.

Below shell script demonstrates how we can read all file names and iterate through it. For Demo purpose, I’m just adding white space at end of each file however you can do anything as per you continuous integration pipeline requirement.

# File name - 
# Read list of all unique file and store as array - 231327
echo "Provide Pull Request Number"
read prNumber
echo "Your entered $prNumber"
#Read all files that are part of Git
fileNames=$(  git log origin/remoteBranchName --grep "$prNumber"  --pretty=format: --name-only | grep -v -e "^$" | sort | uniq )
#convert variable to array
IFS=$'\n' array=($fileNames) 
echo "------ Printing file names"
for element in "${array[@]}"
    echo "Trying to add White space in $element"
    printf " " >> $element  

To run above file just use command


Frequently Used Git Commands

Set Git to store credentials

Below command can be executed from anywhere in your system.

git config --global credential.helper wincred

Turn off Warning _LF will be replaced by CRLF_

git config core.autocrlf true
git config --global core.autocrlf true

In Unix systems the end of a line is represented with a line feed (LF). In windows a line is represented with a carriage return (CR) and a line feed (LF) thus (CRLF). when you get code from git that was uploaded from a unix system they will only have an LF.

Categorized as Tech Tips Tagged

How to setup Git Server using Bitvise SSH

Recently for one of client, I was in need to setup Git on their intranet. Being healthcare industry and compliance issue, source code could not leave company network and therefore needed in-house solution for Source Code Management (SCM) and automate builds.

In this blog post, I will explain how did we setup Git server that is accessible from anywhere in company network.

We need below two software installed on system which will act as a Git Server.

  1. Git (Free)
  2. Bitvise SSH Server (Paid )

First we need to install Git on server and add path of “git.exe” in environment variable, so that we can use git command from console.

Next, we need to install Bitvise SSH Server and set it up. Once, Bitvise SSH Server is installed, we need to follow below steps.

Step 1: Open Bitvise SSH Server control panel as shown in below image

Bitvise SSH Control Panel
Bitvise SSH Control Panel

Fix Git errors : Permission denied , Cannot spawn , No supported authentication methods available

Recently, I came across few errors of Git and found very time consuming to fix those. Let’s discuss what are those errors and how we can fix it.

Error : Permission denied (publickey). fatal : could not read from remote repository

Git permission denied error
Git permission denied error

This error came while trying to push changes to remote repository using ssh keys. This error means we need to provide information about SSH key. it can be done by setting environment variable GIT_SSH.

Continuous Integration in Salesforce using Flosum AppExchange

This is first of many upcoming articles on evaluation of Salesforce AppExchange products. In this post we will be discussing capability of native 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 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

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 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.

How to use PostgreSQL in Nodejs

I have written many articles on Node.js and AngularJs. In this article, I will demonstrate how to use PostgreSQL with Node.js and deploy on Heroku. I think you already smelled that this is one of starting article which will finally merged with Salesforce to create some cool application.

Assuming you already have some background knowledge on Node.js and Heroku, If not please visit previous articles of this blog or my Slideshare account. Using Angularjs is totally optional and you can use library like JQuery or plain JavaScript.

To connect PostgreSQL, we need “pg” module.

PostgreSQL in Node.js
PostgreSQL in Node.js

Create Node.js Application using Eclipse and deploy to Heroku – Video Tutorial

In Below video, I have explained how to create basic Node.js application in Eclipse with help of Egit and Heroku plugin and deploy to Heroku.

Please read below two articles, to get familiar of Plugins and how to setup :

  1. Salesforce + Git + Eclipse + EGIT = Better and Distributed Source Control
  2. Creating First Application in Heroku using Eclipse