Salesforce Integration Patterns & Best Practices – with Video

When to use which integration patterns in Salesforce along with best practices. Video to show how to use Outbound message to integrate Salesforce without writing code

Recently I gave talk in one of most active webinar of Salesforce ecosystem today – Apex hours on topic Integration Patterns and Best Practices in Salesforce.

Response was more than expected and questions were high quality. Therefore, I thought to quickly write high level summary of presentation in this blog post along with Youtube video that you can find towards the end of this post.

Firewall, Proxy and Reverse Proxy

Before integrating anything with Salesforce, as per Architect, it is necessary which system components are important for security and may impact with integration pattern to be used.

Firewalls : It controls and protects Malicious Traffics. Firewall can be hardware or software based.

Proxy aka Forward Proxy : Proxy normally configured in your browser or systems like VsCode, data loader, eclipse to hide your actual identity. Every outgoing request transmits through proxy server to make sure external systems unaware about your true origin and identity

Reverse Proxy : Its used by Web Servers and sits before it. It can server any purpose like authentication or perform security related stuff. Best example is Mulesoft where we can configure API proxy which is used to apply throttling, avoiding DoS attacks or applying SLA as per licenses provided to customer

Continue reading “Salesforce Integration Patterns & Best Practices – with Video”

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

Trailhead Challenge Errors & Solutions

Solutions to Trailhead Challenges

Sometime Salesforce Trailhead Challenge requirement and actual solution doesn’t go hand in hand. And seems many others also face same issue , Thats why I would be making notes on how I fixed Trailhead challenge issue.

Note : I would not be sharing solutions of Trailhead challenge , I will post fix only when there is discrepancy in what’s being asked and what worked.

Setup Escalation and Entitlement

Solution to this challenge would not work if you have Person Account enabled in Org. Try solution in non Person Account Org.

Pricing Methods for Salesforce CPQ – Implement Block Pricing

Error : The second Block Price for the Mobile Control Center App is not configured correctly. Check the Lower Bound, Upper Bound, and Price.

Solution : Create Block Line items as per below image. Salesforce is clearly asking for 1-4 but it needs 5 as upper limit. 5-10 but it needs 11 as upper limit.

Podcast – How to Achieving Hyper-Threading in Salesforce

Total number of Asynchronous Apex which includes Batch Apex, Future Method, Queueable & Scheduled job is 250k or 200 x Total User license whichever is greater.

Now lets do some fact check :

  • Execute method of Batch Apex can only call 1 Queueable
  • Scheduler can call 50 Queueable
  • We can have only 100 Schedulers in an Org
  • If we run 1 Scheduler every minute = 60 Scheduler
  • If each Scheduler executes 50 Queueable every minute, then 60×50 = 3000 jobs / min. Which means 3000 x 24 = 72k jobs / hour

Big Question

Can you design an application which can use full potential of Async governor limit – even 250k / day ?

Designing Scalable Hyper Thread Application in Salesforce

I have discussed various approach to answer these questions on below podcast by SalesforceWay

Part 1 – Salesforce Hyper-Threading Road blocks

Part 2 – Salesforce Hyper-Threading Options

Feel free to drop comments and your thoughts on solution !!!

Federated Search in Salesforce

Search content of Jitendra Zaa’s blog using federated search in Salesforce

Using Federated Search, we can search for content outside Salesforce. Federated Search utilizes Open Search Document behind the scene. Open Search was coined by Jeff Bezos (CEO – Amazon) in March 2005. Open Search is a collection of technologies & standards that allows publishing of results to be utilized by Search Engines.

For Demo purpose, I have enabled my website compatible with Open Search at below URL

https://www.jitendrazaa.com/blog/wp-json/opensearch/1.1/document

Step 1 :

Add External Data Source by clicking New External Data Source.

Provide any suitable name – in this case Jitendra’s Blog.

Select Federated Search : OpenSearch as Type.

Provide this path for OSD (Open Search Document) file format – https://www.jitendrazaa.com/blog/wp-json/opensearch/1.1/document

Click on Validate and Sync.

Step 2 :

Create permission set giving permission to view this External Object and all fields. Assign this permission set to anyone who needs to use search for content outside Salesforce.

We can also enable this federated search in Communities by updating global Search Component and giving community members access to this newly created permission set.

Once above setup is completed – you can search for any term on global search and select External Results as shown in below image :

Install Manage Package in Scratch Org using Salesforce DX

Install CPQ, Field Service Lightning, B2B Commerce cloud in Scratch Org using SFDX Command

There are tons of useful SFDX commands available to help automate Salesforce deployment. However one of most important aspect of Salesforce DX is capability of spinning org within few minutes with features enabled like Person Account, Communities etc.

There could be times, where these commands might not be sufficient. I recently cam across such scenario where I wanted to install manage package for quick capability check.

Scanned through documentation, Stack Exchange and spent lots of time figuring out on how to automate package installation. There are many commands available to install second generation package but not manage package itself. Then I came across marty chang’s github repository with instruction.

Continue reading “Install Manage Package in Scratch Org using Salesforce DX”

Use Lightning Web Components in Flow

Endless limit for your Salesforce application by combining Flow with Lightning Web Components (LWC)

As part of Winter 20, we can embed Lightning Web Components in Flow. Imagine, endless possibilities for Rapid Application Development (RAD) and ease of maintaining application.

Few examples where this could come handy are like embedding lookup components (no more workaround), showing data table, capturing signature, slide shows and so on.

It’s time to jump into water. In this blog post, I would be creating Simple Lightning Web Component (LWC). This LWC Component would be able to get value from flow, pass value to flow, navigate to Next screen and hookup into flow validation engine to restrict next page navigation if there is error in LWC input.

Note : Read this blog post to learn how to embed Aura Component in Flow.

Continue reading “Use Lightning Web Components in Flow”

Data exchange between Aura, Lightning Web Components (LWC) and Visualforce

Using Lightning Message Services for event Communication between Lightning Web Components, Aura Components and Visualforce

Few months back, I wrote an article on how pub sub model can be used to communicate between Lightning Web Components. In that blog post, we used external library to pass event from child to Lightning Web Components.

Lightning Message Service

In Winter 20, Salesforce released Lightning Message Service which can be used to exchange data between Visualforce, Aura Component and Lightning Web Components. Unlike previous process, we don’t need to import any external library like pub or sub.

In this blog post, I would be creating Visualforce, Aura Component and Lightning Message Service and exchanging message between all of them using Lightning Message Service.

Continue reading “Data exchange between Aura, Lightning Web Components (LWC) and Visualforce”

Lightning Web Component Event Handling – Pub Sub

Author posted by Jitendra on Posted on under category Categories Salesforce and tagged as Tags , with Leave a comment on Lightning Web Component Event Handling – Pub Sub

How to handle events in Lightning Web Components between nested and non nested Components

It is very common to come across use case of communicating between Lightning Web Components.

If you are not interested on code explanation and directly want to jump on live demo , check this playground.

Communicate between Nested Lightning Web Components

This is one of most simplest and common use case, where parent LWC wants to react on event produced by child LWC.

In above image, Model 3 is child (nested component) of Tesla.

Continue reading “Lightning Web Component Event Handling – Pub Sub”

Framework to fix – Governor Limit of 100 jobs in Flex Queue

How to design an application in Salesforce to handle governor limit error of maximum 100 jobs in Flex Queue

Recently , I inherited an Org with huge customization , which enqueue 100+ Batch Jobs in few scenario. Now, don’t ask me why ?

I remember, few years back, Salesforce had limit of 5 Apex Batch that can be executed at a time, but we had expectation and demand !!! Salesforce introduced Flex queue and we can have 100 Batch apex waiting to be executed, still we are not happy. After all, human is wanting animal.

After 100 Batch apex, all jobs were failing with error System.AsyncException You have exceeded the limit of 100 Jobs in the flex queue. As I explained my life previously in this post, I had to fix this issue as well.

Right way to fix it was to analyze existing code, perform code review, why do we need even customization etc.. However, time was crucial and I had to do something quickly.

Below framework was used to fix the issue

Continue reading “Framework to fix – Governor Limit of 100 jobs in Flex Queue”