When developing new features, some time we reach org character limit. In that case we have to remove unused code from Salesforce org. Let us create excel report of all custom metadata like custom field, apex classes, lightning component, flow etc from tooling api. In our last post Find Referenced Metadata using Salesforce Dependency API dependency is checked for specific custom metadata. This post will get list of all custom metadata in hierarchical grid. If metadata is used somewhere it will show detail where it is used. Steps for getting complete metadata detail: 1. Get list of All custom metadata…
Author: Dhanik Lal Sahni
While developing new enhancement or user story we introduce lot of new features in Salesforce Application. Before doing changes in existing system, we need to analyze referenced objects. We can not easily identify referenced objects. Salesforce has introduced new object MetadataComponentDependency in Tooling API to resolve this problem. We can get references of all custom objects like fields, class or lightning components using this new object. We can also utilized this object to identify unused metedata so that it can be removed from org to increasing code limit. Let us see, how we can get dependency of metadata object. In this…
I got requirement from my team where they wanted list of fields which are used or placed on page layout. They wanted to extract fields without any App Exchange product or tool. For this requirement i have used Metadata API and Tooling API in apex to get list of all field by specifying page layout. Below are steps which we have to perform for getting fields Get Org objects Get Layout of object Get field of Page Layout Show above object, layout and fields information on Lightning Web Component Download fields as CSV File 1. Get Org objects First we…
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…
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; }…
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…
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…
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:…
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…
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…