salesforce
  1. salesforce-apex-enhancedlist-component

apex:enhancedList Component

The apex:enhancedList is a Visualforce component in Salesforce that allows adding a list view of sObjects with enhanced functionalities in a Visualforce page.

Syntax

The syntax for using the apex:enhancedList component is as follows:

<apex:enhancedList listId="ListViewId" height="heightValue" rowsPerPage="numberOfRows" target="_blank" 
                   type="objectName" customizable="true/false" />

Example

Here is an example of the apex:enhancedList component:

<apex:page>
    <apex:form>
        <apex:enhancedList listId="00Bxx00000001cDEAQ" height="400" rowsPerPage="20" target="_blank"
                           type="Account" customizable="true"/>
    </apex:form>
</apex:page>

Output

The apex:enhancedList component renders a list view of sObject records as a table with advanced functionalities like pagination, searching, sorting, and editing.

Explanation

The listId attribute is used to specify the ID of the list that will be displayed using the component. The height attribute is used to specify the height of the table in pixels. The rowsPerPage attribute is used to define the maximum number of rows displayed per page. The type attribute is used to specify the sObject that will be listed. The customizable attribute is used to determine if the user can customize the list view.

Use

The apex:enhancedList component is used to display sObject records in a table format with enhanced functionalities. It is especially useful in cases where a list view with advanced functionality is required in a Visualforce page.

Important Points

  • The listId attribute is required to be specified to display the list view.
  • This component is only relevant for Salesforce Classic UI as it has been replaced in Lightning Experience with standard Lightning components.
  • The target attribute is used to specify whether to display the list view in a new window or the current window.

Summary

apex:enhancedList component is an easy-to-use Visualforce component in Salesforce to add advanced functionalities to a list view of sObjects in a Visualforce page. By providing the type attribute with sObject name and other attributes like height, rowsPerPage, customizable and target, the component renders a list view of records in a table format with advanced functionalities like pagination, searching, sorting, and editing.

Published on: