Lightning-datatable element is used to show records as tabular format in lighting web component. By default lightning-datatable support multiple row selection. Recently one of my colleague asked how we can restrict single row selection in lightning-datatable with checkbox not with radio button. lighting-datatable has property max-row-selection will restrict maximum number of records can be selected. If we set 1 as value then instead of checkbox it will be show radio. This blog will just restrict single row selection with checkbox in lightning-datatable. Let us handle this use case to restrict lightning-datatable to support single row selection. Here is code to…
Author: Dhanik Lal Sahni
Object Detection is used to locate the presence of objects in the image. We can find the location of the object as well in the image. It can detect a single object as well as multiple objects in the image. As an example in the above image, we can get the number of objects in the picture, the classification of the object (cat, dog, duck), and the location of the object. Lots of APIs are available for object detection. Here is a list of those top APIs This post is using Google Cloud Vision API to detect objects in the…
Images are best to showcase products or brands on websites. These images can be divided into multiple sections using an image map to show specific products or brand information. We can use HTML image maps to create clickable areas on an image. Image maps are used hyperlink parts of an image to a different destination. HTML Elements Used to Create Image Maps There are three HTML elements used to create image maps: Example: Let us build this as a dynamic Lightning Web Component in Salesforce. We need image and image coordinates to make a clickable image component. We can create a…
Logo recognition allows companies to detect where on the web their brand logo appears. Companies pay hefty amounts to sponsor events and raise brand visibility. This brand awareness benefits companies in different ways like new leads and sales, keeping the brand at the top of customer minds. Artificial Intelligence can help in recognizing a brand that is floating on the internet. There are many software and APIs which can help us in recognizing the company logo. Below is a list of top logo detection APIs In this post, I will explain logo detection using Google Cloud Vision API. I will try to integrate…
Amazon S3 Server is used to store Salesforce files. These stored files can be viewed later whenever is required. This blog will explain how we can display file in iframe. Here are other blogs related to uploading and downloading files using lightning component to Amazon S3 server. https://salesforcecodex.com/2020/01/download-files-from-s3-server-using-apex/ https://salesforcecodex.com/2020/01/uploading-files-to-s3-server-using-apex/ Steps to create View S3 File component in LWC Let us see these steps in detail 1. Upload S3 SDK for JavaScript Download AWS SDK file from https://raw.githubusercontent.com/aws/aws-sdk-js/master/dist/aws-sdk.min.js and upload this as static resource. You can put name AWSJSSDK for this static resource. Add http://s3.amazonaws.com in remote site setting. 2. Create…
Many time we have use case to add child/grand child component on main component. If we found any error in life cycle events (e.g. connectedCallback, renderedCallback) of child or grand child component, that error should we shown on parent component instead of respective child component. In lightning web component has excellent feature errorCallback which creates a error boundary. This error boundary captures all errors from its descendent component tree for life cycle events. It will not capture any other events issue like button click handler issue. We can log and show life cycle event error based on our application design.…
Lightning Web Component has an excellent element lightning-tab that keeps related information in a single container. By default, it will not show icons along with the label. Normally we want to show icons as well with labels. Let us see how we can add an icon in the lightning web component tab. Example of lightning-tab without an icon. This will produce the below output. Let us add an icon in the lightning-tab. Add the below code in the component js file. Put this icon variable in html template file in icon-name attribute of lightning-tab element. References: Lightning Icon Documentation Related…
Nowadays organizations are going for digital automation for most of their repetitive work like manual records entries from printed forms. This manual entry requirement can be for the application form, insurance forms, doctor prescription forms, examination forms, digitized business cards, and many more. This post will explain the OCR App using Salesforce Einstein to extract text from images and populate them in Salesforce objects. For extracting text from images we have many API service available which gives almost 95% accuracy. Refer to my other post related to this service. Salesforce announced OCR (Einstein Optical Character Recognition) service in Apr,2019. This…
Last week I got a request about extracting the vehicle license plate numbers. Requester wanted to extract the license plate number from the image. I was not sure that we have a specific API for this request. After analysis, I found License Plate Number APIs which can extract plate numbers from images. To extract the license plate number from the image in Salesforce, we have to complete the below steps 1. Get the test credential from RapidAPI Create an account in RapidAPI.com to test License Plate Recognition API. Once the account is created, go to https://rapidapi.com/macgyverapi/api/license-plate-recognition1 and get a test…
While working with product development in Salesforce, We implement lot of development process like code guidelines process, code review process, release management process, org management process etc. This process help us in stream line our development and release process. In development process we also want that all developer follow same type of code practice in complete application. We can share development guide with each developer to use same practice but it is followed or not it is difficult to find in initial stage. We will get to know only when we get code review request. So might be possible it…