Author: Dhanik Lal Sahni

With over 18 years of experience in web-based application development, I specialize in Salesforce technology and its ecosystem. My journey has equipped me with expertise in a diverse range of technologies including .NET, .NET Core, MS Dynamics CRM, Azure, Oracle, and SQL Server. I am dedicated to staying at the forefront of technological advancements and continuously researching new developments in the Salesforce realm. My focus remains on leveraging technology to create innovative solutions that drive business success.

Tooling API is used for custom development tools or apps for Lightning Platform applications. Tooling API’s SOQL capabilities for many metadata types allow us to retrieve smaller pieces of metadata. I was having a requirement to get list of all page layout for my object using Tooling API. I have called Tooling API from apex and used UserInfo.getSessionId() as authentication token. But when i called that apex method from lightning web component, i was getting below error. INVALID_SESSION_ID:This session is not valid for use with the Rest API. So our UserInfo.getSessionId() will not work as authentication token when we call Tooling API…

Read More

Most of time we need to compare values or two controls in record pages. Instead of writing code at multiple places we can create compare element in lightning web component and we can use this at required pages single or multiple times. Compare Element Requirement That element’s value should compare with other element That should compare values in same element To compare with element, we need to find that element. By default we can not access other component’s element.  To access element of other component or parent component we have to pass that component as property. //Page export default class AppForm extends LightningElement {     parent=this; }…

Read More

Recently I got request from one of my blog member for extracting text from image which is uploaded in Salesforce record’s attachment. So i have analyzed some APIs which has similar capability. There are various tool and APIs available for extracting text from images. Here are some of them which are popular in market Google Cloud Vision Microsoft Computer Vision Taggun Cloudmersive For this blog, i have used Google Cloud Vision to extract text from image.  This OCR (Optical Character Recognition) API has special feature to recognize logo as well. The Google Cloud Vision API enables developers to understand the content of…

Read More

Recently we got a requirement to show list of account for getting status of uploaded document. If document is already uploaded  then list will show ‘No action required’ otherwise it will show file upload control. As per requirement we have to show list or table of records so we can extend standard lightning-datatable with conditional file upload control. Let us how we can extend lightning-datatable with file upload control. There is another blog https://salesforcecodex.com/2019/10/show-image-in-lightning-web-component-data-table/ which show how to add image control in lightning-datatable. We can use similar concept to add file upload control in lightning data table. Steps for extending  lightning-datatable Create…

Read More

Salesforce has postponed it’s upcoming summer release due to current COVID-19 pandemic.  As per company , many customer’s have updated that their businesses are affected due to COVID-19. They don’t want new enhancement to be introduced in current applications.   The Summer ’20 sandbox preview was scheduled for May 8, 2020, and the Summer ’20 production release was originally scheduled for May 15, June 5, and June 12, 2020. Now new Summer ’20 release schedule will be as below: Sandbox preview: May 29-30, 2020 Summer ’20 Production release First Release window: June 12 Second Release window: July 10 Third Release window:…

Read More

Recently my team got requirement to send report as email attachment to external users.  This blog will show number of ways we can send report as attachment in email. We can send report to our internal user using standard schedule report but we can not schedule to send email to external user. Here are some options which can be used to solve this requirement. Create attachment using SOQL and add data as attachment Create attachment using Apex from standard report Create user and send to that user email Create attachment using SOQL and add data as attachment  We can create…

Read More

In last blog COVID India Real Data In Lightning Community , I have given detail about showing live data of COVID19 patients. In this post, I will show that data in chart for all states. I have used chart.js for creating bar chart.  For creating chart using this library we need below four information. Numeric data in array which we need to show Labels in string array options or setting for chart type of chart. Chart can be bar, line etc. You can check type from chart.js site.  var lineChart = new Chart(ctx, {             type: ‘bar’, //point 4             data: {                 labels: this.stateNames, //point 2                 datasets: [{                     label: ‘States’,                     backgroundColor: this.colors,                     data: this.values, //point 1…

Read More

Many time we get requirement to uploading multiple files using lightning component. This post give detail about how to upload multiple files. Steps to complete this requirement Create Apex class which will save record in record as attachement Create Lightning Component to upload documents Add above created component in page to test it 1. Create Apex class to save record we need to create apex class to save selected files in record as attachment. Files which is uploaded first time will be created as attachment. Already uploaded files will be update with new contents. Apex Code: 2. Create Lightning Component…

Read More

Coronavirus disease (COVID-19) is an infectious disease caused by a newly discovered coronavirus.  World is danger due to this pandemic. More then 7 Million public is positive with this virus. This post will help in creating Lightning Community to show real time data of COVID virus patients in India.  To show real time data we need below steps API which will give real time data Consume above API in Salesforce Public Lightning Community Lightning Component to show data 1. Real time data API Real time data for COVID patients is available at https://api.covid19india.org/. You can also get information about patients at https://github.com/covid19india 2. Consume API…

Read More

Version Control is important for Team-Based Development for every organization.  We can use TFS or Git for versioning control. What is Git? Git is distrbuted version control system. Distributed version control systems give developers flexibility and freedom by providing every collaborator with a copy of the entire repository at any time, including all branches (lines of work) and commits (saved points in history) on a developer’s local machine. What is Github? Github is collaboration platform built on top of Git. GitHub serves as a community space where we can share our work, see our team’s work, complete code reviews, and…

Read More