Salesforce Integration with SQL Server Integration Services

Author posted by Jitendra on Posted on under category Categories Salesforce and tagged as Tags , , , with 1 Comment on Salesforce Integration with SQL Server Integration Services

Video – Connecting SQL Server Integration Services (SSIS) with Salesforce using COZYROC Connector

On April-14, 2018,  I had a chance to conduct online session on demonstrating integration between SQL Server Integration Services (SSIS) and Salesforce with the help of COZYROC connector.

This session covered below topics

  • Introduction to ETL
  • What is SQL Server Integration Services (SSIS)
  • COZYROC connector
  • Demo of extracting and updating records in Salesforce
  • Demo of downloading attachments from Salesforce
  • Demo of uploading attachments in Salesforce
  • Best Practices – How to configure SSIS package to avoid hardcoding
  • Best Practices – enabling logging

Continue reading “Salesforce Integration with SQL Server Integration Services”

Video – Use Microsoft Azure’s Active Directory as Identity Provider for Salesforce SSO in 15 Minutes

Video tutorial on how to use Microsoft Azure’s Active Directory as a Identity Provider for Salesforce. It uses Federated Single Sign On (SSO) feature of Salesforce

This is quick video tutorial on how Microsoft Azure can be used to setup as Identity Provider for Salesforce Single Sign On.

Few things worth of note:

  • If you are new to Microsoft Azure, you can get free trial access however you might need to provide Credit card details to use few features. You would not get charged because we get $200 worth credit for new Account that can be used in a span of year.
  • I was not able to use Azure’s Active Directory SSO for Just in Time (JIT) provisioning. Rather, it connects to Salesforce and creates user whenever user is provisioned in Active Directory, just like Identity Connect
  • Security token is mandatory. In case if you have IP login range then we don’t get Security token. To fix this, we can divide our password to have some value in Security token. As final password anyways is Password + Security Token. Shown in below image
  • When we assign any user to Enterprise application (in our case its Salesforce), we need to map profile to the user.
Microsoft Azure Active Directory User Provisioning
Microsoft Azure Active Directory User Provisioning

Introduction to Lightning Test Services with Jasmine

Complete Source code and video of using Lightning Datatable Component and Jasmine in Salesforce

In previous post, we discussed what is Jasmine and simple hello world program to see how it works. In this blog post, we will discuss how Jasmine can be used in Salesforce to test Lightning Component’s Javascript code.

Note : Everything we are discussing here is completely covered as part of Live coding in Apex Salesforce Saturday organized by Amit. Would like to thank Mohith for his support and answers during the demo. It also shows How SalesforceDX can be used daily by developers to perform development.

Jasmine and Mocha support is provided as a part of Lightning Test Service (LTS) by Salesforce. Jasmine and Mocha, both are well known and industry wide solution accepted in Javascript world. of course, Salesforce don’t want to stay behind in terms of its offering to developers thats why we have new baby in town – Lightning Test Service (LTS). Continue reading “Introduction to Lightning Test Services with Jasmine”

Getting Started with Jasmine Test Framework

Introduction to Jasmine framework and getting started with Behavior Driven Development (BDD) testing, along with Complete Source code and Video

Jasmine is a Javascript Testing framework which starts with behavioral specifications as a basis for writing test cases. To put it another way, you can consider user stories as a reference for write test cases. Each user story in your project can have one or more Jasmine test cases.

Majorly, Jasmine is made up of three functions

  1. describe
  2. it
  3. assertions (expect)

Like standard frameworks, it also has setup method and tear down methods

  • beforeEach() – Setup Method
  • afterEach() – Teardown Method

For the sake of simplicity of post, I would not discuss much in detail. However, you can navigate to official Jasmine guide for deep dive. Continue reading “Getting Started with Jasmine Test Framework”

Using JWT Flow to Authenticate Nodejs application with Salesforce

Video tutorial and Complete source code to use Salesforce JWT OAuth to authenticate Nodejs Application

JWT OAuth uses digital signature to authenticate external application with Salesforce. JWT can be used to request an OAuth access token from Salesforce when a client wants to use a previous authorization.

Complete Source code is available here.

How JWT OAuth works
  1. Developer creates a connected app and provides digital certificate in OAuth settings. You can refer this post to understand how openssl can be used to create digital certificate locally.
  2. We need to make sure this connected app is already pre – approved either by using WebServer, User Agent or any other flow. You can find this step in video recorded.
  3. We need to generate JWT token and sign it with certificate. This code snippet is available in this file in method getJWTSignedToken_nJWTLib(). I have used njwt module of Nodejs to create a JWT token. This is very useful website to validate and generate JWT token as per digital certificate.
  4. Next we need to send JWT request to token URL –  https://login.salesforce.com/services/oauth2/token
  5. If JWT request is valid then Salesforce returns access_token , which can be used in subsequent requests to perform allowed operations in Salesforce via Nodejs application.

Continue reading “Using JWT Flow to Authenticate Nodejs application with Salesforce”

Performing Load Testing in Salesforce using Selenium and TestNG

Parallel execution of browsers in Selenium with the help of TestNG and determining maximum operating capacity of custom code in Salesforce

When we build any custom solution in Salesforce, key is to write an efficient and meaningful Apex test classes for sure. However sometime we may need to test how custom application would behave in maximum operating capacity. Here, I am talking about Load Testing of custom applications built on top of Force.com platform. Recently I needed to push my code to its limit to know how many concurrent users can use it before hitting any governor limits. Quickly I realize that its time to call my friends Selenium and TestNG.

Before doing any extensive stress or load testing on Salesforce, we must need to contact Salesforce support and explain them what we are trying to achieve. More detail available in this official Salesforce blog post.

I have published some blog posts about Selenium in past as well however whats different this time ? I need to determine after how many simultaneous user interactions, I would hit Concurrent Apex Limit error as shown in below image.

Salesforce Governor Limit error - Concurrent Apex Limit
Salesforce Governor Limit error – Concurrent Apex Limit

Continue reading “Performing Load Testing in Salesforce using Selenium and TestNG”

Getting started with Salesforce DX – Salesforce Developer Experience

Introduction and basics of Salesforce Developer Experience (Salesforce DX) with source code and Video tutorials

Important : At time of writing this post, Salesforce DX is in pilot phase. Mostly any product in Salesforce goes from Pilot to Beta and then Generally available. There is no guarantee that if this product is released, it would work like exactly same as written in this post.

Table of Content

If we already have Salesforce Metadata API, Force.com IDE and other tools then why do we need one more tool like Salesforce DX ?

In tools like Changeset, Metadata API or Force.com IDE, source of truth is Sandbox. Although we can setup process and continuous integration (CI) to use some source code management (SCM) like Git or SVN. However these kind of setup takes time, expertise and lot of effort.

Salesforce DX not only solves above problem but

  • Ability to consider SCM as source of truth
  • Use any favorite IDE or any SCM
  • Powerful CLI to help minimizing complexity of setting up CI
  • Updated Force.com IDE to support Salesforce DX if you are not comfortable with CLI
  • and most important, spin off Scratch Orgs within minutes through script to quickly work on POC or package based development

What are scratch Orgs ?

Salesforce DX can be enabled for any Salesforce instance and they are known as Developer Hub. One Developer Hub can have multiple Scratch Orgs. Scratch Orgs are temporary Salesforce org which can be created quickly and metadata can be deployed from SCM. These kind of Orgs can be used by developers to perform quick proof of concept or build and test packages. Once package is build and saved back on SCM, scratch org can be destroyed easily. Continue reading “Getting started with Salesforce DX – Salesforce Developer Experience”

Export or print code review feedback generated by Salesforce Lightning CLI

How to print or export code review feedback report generated by Salesforce Lightning CLI tool

Update : We can use this heroku app to scan Lightning component online and get code review feedback. Complete source code is available here. We don’t need to install Lightning CLI until its project compliance issue.

Salesforce Lightning Component - Code review - Javascript lint
Salesforce Lightning Component – Code review – Javascript lint

In this post, we discussed that how Lightning CLI can be used to get a code review information of custom Lightning component. However, code review is either printed or exported as a file in text or JSON format. Question is, how to get Lightning component code review feedback in HTML or PDF format ?

I tried various options available here however there were no way to export code review feedback generated by Lightning CLI. Output generated by Lightning CLI is not presentable to business executives or clients.

Finally, I came up with very simple Heroku application, which can be used to get Lightning CLI code review feedback in HTML or pdf format. We need to run below command to get CLI code review in JSON format. Continue reading “Export or print code review feedback generated by Salesforce Lightning CLI”

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”

Dynamically remove XML content from metadata before Salesforce deployment using xmlTask – Video

Example – automatically remove listview before deployment

Many post about deployment using ANT has been posted on this blog like auto backup complete Salesforce instance daily, upload Salesforce data on FTP Server, auto generate package.xml, continuous integration and so on.

While implementing real Continuous integration in Salesforce, we need to perform various adjustments in metadata before deploying it to build server or production instance, many automated scripts (automation) are needed. If you need to change ANT scripts or metadata frequently, then it means continuous integration or deployment process in your Salesforce project is not yet fully matured.

There could be multiple situation where we don’t want some component to be deployed on production and example of one of them is List view Continue reading “Dynamically remove XML content from metadata before Salesforce deployment using xmlTask – Video”