- 03 May 2024
- 3 Minutes to read
- Print
- DarkLight
Define fields for the CDT table
- Updated on 03 May 2024
- 3 Minutes to read
- Print
- DarkLight
Define the fields that will appear in the Configurable Data Table (CDT) Lightning component(s) that use the defined data table configuration.
To define fields that will display in the CDT component
- From the App Launcher, select Data Table Configurations, then select the configuration you defined.
- Go to the Related tab. In the Fields Configuration section, select New.
- In the New Data Table Field Configuration dialog, enter information or make selections:
- Field Configuration Name—Enter a descriptive name for the configuration.
- Data Table Configuration—Enter the Data Table Configuration Name that you defined.
- Field Name—Enter the API name of a field from the sObjectName that you defined. For example, AccountNumber for a standard Salesforce field, or zpf__SLAExpirationDate__c for a custom field.
- Field Label Override—Enter a string value that overrides any existing field label translation.
- Visible—Select this checkbox to make the field visible in the rendered rows of the CDT Lightning component.
- Field Width—Enter the desired width of the field in the data table (must be > 0). This applies only to the Fit to Page mode.
- Field Order—Enter the order (starting with 1, from left to right) in which the defined fields are rendered as columns in the CDT component.
- Default Sort—From this dropdown, choose whether or not the rendered column will be sorted.
- Multi-Level Sort Order—Enter the desired multi-column sort order (starting with 0, from first to n sort order). Leave this value blank for fields that aren't part of the desired sort order.
- Select Save.
To define filters for fields to be displayed by the CDT component
Define filters to limit the records displayed in the rendered output of the CDT Lightning component. You can configure a set of static field filters and/or apply a custom filtering logic by defining a custom APEX hook.
To configure static filters
- From the App Launcher, select Data Table Configurations, then select the configuration you defined.
- Go to the Related tab. In the Filters Configuration section, select New.
- In the New Data Table Filter Configuration, enter information or make selections:
- Field Filter Name—Enter a descriptive name for the filter.
- Data Table Configuration—Enter the Data Table Configuration Name that you defined.
- Field Name—Enter the API name of a field from the sObjectName that you defined. For example, AccountNumber for a standard Salesforce field, or zpf__SLAExpirationDate__c for a custom field.
- Operator—From this dropdown, choose the comparison operator for your filter value.
- Value—Enter the filter value.
- Select Save.
The following image displays an example of the static filter configuration:
To configure filters by using APEX hook
Use the APEX hook when your desired business logic for filter field comparisons cannot be applied by using Salesforce formula fields and dialog filters. This hook occurs before records are loaded into the CDT view on a user’s screen. The products are first processed by the custom logic in the hook, and are then loaded into the user's view.
For more information on the hook, read CDT Scoped Records Filterer Class.
You can combine both static filters and custom APEX hook. If you do this, the results of both approaches must evaluate as TRUE on any given product to display it in the Configurable Data Table view.
Supported Field Data Types
The field data types that are not listed in this table will be treated as text, and therefore may not display properly in the CDT component. For example, the Geolocation data type will be displayed as an empty field in the rendered output of the component.
Supported Field Data Types | Correct Value Format |
---|---|
Checkbox (Boolean) | For example, true/false, TRUE/FALSE, 1/0, True/False, tRUE/fALSE(any letter case) |
Currency | Currency symbol (with localization formatting) |
Date | YYYY-MM-DD (with localization formatting) |
DateTime | YYYY-MM-DDThh:mm:ss+hh:mm YYYY-MM-DDThh:mm:ss-hh:mm YYYY-MM-DDThh:mm:ssZ (with localization formatting) |
Text value (without hyperlink) | |
Formula |
|
Id | As a hyperlink or as a label |
Lookup | Object Ids are displayed as object names with a link to that object |
Name | Field value displayed as a label |
Number | Decimal numbers. For example, 10, 10.0 |
Percent | For example, 0.11 as 11% |
Phone number | Text value (without hyperlink) |
Picklist | Text value (without quotation marks). Can include numbers and special characters |
Text | Text value (without quotation marks). Can include numbers and special characters |
Text Area | Text value (without quotation marks). Can include numbers and special characters |
URL | As a hyperlink |