Salesforce Integration with Nodejs based applications using Canvas

How to use Canvas Signed Request Authentication with web based applications like Nodejs & how to use Canvas LifeCycle Handler Class

Salesforce provides many ways to integrate with external systems like SOAP, Rest, Bulk API, User Interface API and so on. One of useful way to integrate any existing web applications with Salesforce is using Canvas.

For sake of this post, I’m using Nodejs application and complete source code can be found here , on my Github repository. It can be deployed on Heroku easily, however I used my local computer to run canvas. That also proves point that integration is happening via Browser and therefore canvas application can be hosted on premise and not necessarily on DMZ layer.

Step 1 : Create Connected App in Salesforce

Enable OAuth in Connected app and provide any Callback URL. Canvas app does not use callback URL however we DO NEED scope.

Next step would be enabling canvas app itself connected app along with locations where we would be using it.

Continue reading “Salesforce Integration with Nodejs based applications using Canvas”

Sharing records in partner community from different Accounts

As we know there are limited options to share records between community users.

For Customer Community , we can use Sharing set or Sharing Group.

For Customer Community Plus & Partner Community we can use role & Sharing rule. Maximum role that community can have is 3 per account and thats limitation there as well.

Now , lets assume below scenario

Continue reading “Sharing records in partner community from different Accounts”

Mastering Visual Studio and Salesforce DX

Author posted by Jitendra on Posted on under category Categories Salesforce and tagged as Tags , , with 1 Comment on Mastering Visual Studio and Salesforce DX

3.5 hours of video to become Master on using and navigating Visual Studio, Need of scratch org and building modular application using Unlocked Packages

I’m delighted to announce new Udemy course Mastering Visual Studio & Salesforce DX recorded by me and my friend Amit Chaudhary.

This course is for

This course is for you if answer to any of below question is yes

  • New Salesforce Developer and wondering how Visual Studio and Salesforce DX fits together
  • Salesforce Admin who don’t want to stay behind adapting source based development methodology
  • Experience Salesforce developer worked immensely on force.com IDE and ANT migration toolkit but not able to fit with new development paradigm
  • Advance developer or Architect who wants to understand how Unlocked package is different than manage package and unmanaged package
  • Want to streamline CI / CD process by developing some advance plugin

Curriculum

  1. What is Salesforce DX and why do we need it if we already had ANT based metadata tool
  2. How to remember Salesforce DX
  3. How admins can use Visual Studio without knowing Salesforce DX command
  4. Why do we need Scratch Org and difference between scratch org and Sandbox
  5. When to use Scratch Org
  6. How to perform relational data load using SalesforceDX
  7. Automating scripts , from 10 commands to single command
  8. How JWT OAuth works with Salesforce DX
  9. How Salesforce DX plugin boiler plate can be created within 5 minutes

Udemy is running huge sale , Click below image to get discounted price for this course !!!

Video – Large Data Volume – How Lightning Platform Query Optimizer Works

Best Practices of handling Large Data Volume (LDV) in Salesforce

Last year I presented how Query Optimizer works in Kitchner developer group. Found myself coming back to slide multiple times, so thought its good idea to post all information in this post.

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”