Posts

Creating Lightning Data Table with Custom Data Types

Image
Hi all, In this blog, we are going to explore defining custom types in lightning datatable. Before you define custom type, please check if your data type is going to be one the below listed type as lightning-datatable component support these standard data types. action boolean button button-icon currency date date-local email location number percent phone text   (default) url You can define custom data types by using two approaches.  Extending LightningDatatable class. Use this approach, if your use case is simple and It doesn't require use of dynamic custom types.  Use a slot . Use this approach, if you want to use dynamic custom type or require custom styling. Pass the custom types into the lightning-datatable component in a slot. In this example, we are gonna use first approach, Extending the LightningDatatable class.  You can extend from LightningDatatable only to create custom data types.  We are going to define three custom data type - opportunity name in...

Custom File Upload to Salesforce using LWC and Apex

Hi Everyone, In this blog, we'll explore custom way of uploading a file to salesforce using Apex and lightning-input tag.  A file can be uploaded using either lightning-file-upload component or lightning-input (having type attribute as "file") component. Only difference between lightning-file-upload and lightning-input with type as 'file' is that files uploaded by using file-upload component directly get attached to records without writing any additional apex code, whereas you need to write Apex code for attaching files to record while using lightning-input component. Some important points Multiple files can be uploaded by having multiple attribute in component definition. All types of files are accepted and furthermore you can restrict what kind of file you want to upload by specifying valid file formats in accept attribute. Ex:- [".pdf", ".doc", ".jpg"] Uploaded files can be associated to a record by specifying record-id attri...

Client Side Pagination in LWC Component

Image
 Hi Folks, Hope you all are well !! In this post, we are gonna implement a simple client side pagination. Making use of client side pagination is much more simple then having all logic into Apex Class and doing SOQL on each click of Pre and Next button. Let's simplify pagination in below steps :- Get all the result in single Apex call. Hold the main result to a object type variable which further will be used to process the logic on each pre/next button click. Decide how many records needed to show on the page. Process the logic for displaying default number of records and when click on pre and next button. Handle the logic when records on page got changed. for the pagination logic, we have created a separate (child component) which will takes some property from its parent component and will process it accordingly. (Reusability feature). paginationlwc.cmp <template>     <lightning-card title = {cardTitle} >         <div style = "height:...

Using Lightning Message Service aka LMS in LWC

Hey, Welcome Folks !! Let's talk about LMS.  Before going to LMS, lets understand little bit about Lightning Message Channel. Lightning Message Channel is a metadata that stores communication parameters or message. Use this message channel to publish/subscribe the message. Lightning Message Service is unique salesforce feature that allows developers to communicate across the DOM within a Lightning Page (i.e. unrelated components) , using a secure message channel. See the LMS as Application Events in aura framework that allows communication between the components on an application. Using LMS, we can communicate between Visualforce Pages embedded into lightning page, Aura Components, Lightning Web Components, Utility bar components. There are three main steps to use LMS into you web components: Creating a Lightning Message Channel. Publishing the message to Message Channel. Subscribe/Unsubscribe from Message Channel. Creating a Lightning Message Channel Create a folder under force:ap...

Process Automation Specialist Superbadge

Hi Folks, This superbadge is all about to test one's automation skill using superb automation tools which salesforce provide. So, here i'm going to discuss every problem statements / business requirements of Process Automation Specialist superbadge and convert them into a problem solving flow. I would rather say read twice or thrice unless you are not clear with problem statement /requirement to every challenges of this superbadge, doing so, will give you a clear picture  of problem statement. Challenge-1 : Automate Leads Step-1 :  Validation rule on Lead to verify Country and State field. Lead Country must be either US , USA or United State or it can be blank.  Lead State must be valid 2-digit US state.                Steps-2 : Create Two Queues 1. Rainbow Sales. 2. Assembly System Sales. Create an lead assignment rule and make 2 rules entries and give order accordingly. Based on LeadSource value lead should be a...