Posts

Showing posts from April 25, 2023

Show Hyperlink against the Record in Datatable in LWC

Image
  Requirements : Show the case records in the data table. when click on case number it will redirect to the detail page Apex Class: showCaseRecordsinDatatable public with sharing class showCaseRecordsinDatatable {        @AuraEnabled     public static list<case> fetchCases(){         try {             return [Select Id, subject,CaseNumber, Description, AccountID, Account.Name,ContactID, contact.Name,Status, priority from case];                    } catch (Exception e) {             throw new AuraHandledException(e.getMessage());         }     } } --------Create LWC------- <template>     <lightning-card  variant="Narrow"  title="Case List" icon-name="standard:case">         <div class="slds-m-around_small">             <lightning-datatable                 key-field="id"                 data={result}                 show-row-number-column                 hide-checkbox-column                 columns={columnsList}