function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Bhargavi Ananthoju 6Bhargavi Ananthoju 6 

hi , i am a beginner in salesforce and would like to display a list view of custom object. currently we are using visualforce page , prefers lightning view. can anyone suggest us how we should approach to replace the below code with lightning component.

<apex:page lightningStylesheets="true">
<apex:slds />
 <apex:enhancedList listId="XXXXXXXXXXXXXXX" height="500" customizable="false" rowsPerPage="25"/>  
 </apex:page>
Satish PrajapatSatish Prajapat
Hello Bhargavi,
Please use the below code, you can acheive your requirement.

<lightning:listView aura:id="listViewAccounts" objectApiName="Account" listName="AllAccounts" rows="5" showSearchBar="true" showActionBar="false" enableInlineEdit="true" showRowLevelActions="false" />

For more details you can visit below link:
https://developer.salesforce.com/docs/component-library/bundle/lightning:listView/documentation

Regards,
Satish K Prajapat