Share JavaScript Code in Lightning Web Component to Read URL Parameters

Building Reusable LWC Component to read query string from URL

In this post, we would create a Lightning Web Component that can be shared across other LWC as a JavaScript library.

We are going to create LWC Component to acts as a utility method to read query parameter , as shown below

Continue reading “Share JavaScript Code in Lightning Web Component to Read URL Parameters”

Gravatar – Reusable Lightning Web Component

Author posted by Jitendra on Posted on under category Categories Salesforce and tagged as Tags , with Leave a comment on Gravatar – Reusable Lightning Web Component

Avoid asking your users to upload pictures – Use Globally Recognized Avatar , Reusable Lightning Web Component

Wouldn’t it would be great if we can use existing avatar of user on basis of email id instead of asking user to upload their profile pic ?

Gravatar is Globally recognized avatar used by millions of user and many websites like WordPress, github, stackoverflow etc.

Click here for Live Demo – Gravatar Component on public community

In this post, we would create a reusable lightning component which would receive below three parameters to construct avatar

  1. Email address to render avatar
  2. Size of avatar
  3. Should image be rendered as rounded corner

Gravatar would need MD5 equivalent of email address. There is no native Javascript library to compute MD5 hash, either we have to use Javascript library or we can use Apex to compute MD5 using crypto class. I preferred Apex class instead of any other library a shown below

Continue reading “Gravatar – Reusable Lightning Web Component”

Salesforce Load Testing using SOAPUI

Previously, I have added multiple posts in this blog on how you would face governor limit errors on each step of Salesforce implementation and how we can leverage selenium to perform load testing of Salesforce to some extent.

SOAP UI is powerful tool and in this post we will see how it can be used to perform load testing of Salesforce API.

Step 1 : Download PartnerWSDL from your Salesforce instance and create SOAP UI Project.

Step 2 : Create a Test Suite in SOAP UI

Continue reading “Salesforce Load Testing using SOAPUI”

Limitations of LWC

Author posted by Jitendra on Posted on under category Categories Salesforce and tagged as Tags with 3 Comments on Limitations of LWC

Considerations & Limitations of Lightning Web Component in Salesforce

Almost all of us started using LWC instead of Aura or Visualforce however there are multiple occasion where we need to come back to either Aura or Visualforce.

I was not able to find single consolidated list of limitations of LWC and therefore thought to post this blog.

Feel free to comment on this blog post and help me keep this updated.

Unsupported features of Lightning Web Components

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”

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 / day

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 :