The CMDT Filter This feature enables filtering of lookup fields in the Add/Edit lightning modals and Download/Upload Templates using CMDT filters. It introduces a new Custom Metadata Type (CMDT) named xx_Lookup_Filter_Label_Mapping_mdt
, designed to streamline the lookup process with specific conditions.
CMDT Structure
The CMDT includes the following fields:
...
Note |
---|
In the Add modal, when using the operators LESSTHAN, GREATERTHAN, LESSTHANEQUAL, or GREATERTHANEQUAL with a Field-type filter, the field must be included in the modal and must contain a value. In the case of Value it works fine, irrespective. |
Filter Validation and Limitations
Phone Data Type: Values must be passed in an unformatted way (e.g.,
1234567891
), but will be displayed as formatted(123) 456-7891
.Date Data Type:Values must follow the
YYYY-MM-DD
format.Currency and Number Fields: If no value is provided during add/edit operations, the system defaults to
0
for comparisons.Date Fields: If no value is entered, the system treats it as
null
during comparisons.When downloading Activities from the Implementation Plan record page, only fields from the host object (Implementation Plan) can be used for filtering.
The last limitation applies to other download scenarios, Activities and Implementation plan have only been used for representational purposes.
Usage Scenarios
Info |
---|
When working with standard objects, we use the object’s API name followed by |
Standard Lookup Field Traversal: Remove the "Id" from the lookup field API name (e.g.,
CreatedById
becomesCreatedBy.Name
).Custom Lookup Field Traversal: Replace
__c
with__r
(e.g.,ampi__Project__c
becomesampi__Project__r.Name
).
Dynamic Search Filter (DSF)
The DSF supports only the Label Field API Name (xx_Child_Label_Name__c
) for filtering. Only records with values in this field will appear in the lookup dropdown.
User Permissions
Editable Fields: Users can edit only the
IsActive
field and theFilter Condition
.Non-editable Fields: Remaining fields cannot be modified by the user.
Out of the box Lookup Filter Label Mappings available on Amp Impact out of the Box:
Label | Purpose |
---|---|
Parent Activity on IP DL Excel | Activities from the same Implementation Plan should display in the LWC lookups and reference tab in the downloaded template |
PI on Add Activity Modal | Project Indicators from the same Project should display in the LWC lookups and reference tab in the downloaded template |
PI on Edit Activity Modal | Project Indicators from the same Project should display in the LWC lookups and reference tab in the downloaded template |
PI on IP DL Excel | Project Indicators from the same Project should display in the LWC lookups and reference tab in the downloaded template |
FO on Add Activity Modal | Framework Objectives from the same Project should display in the LWC lookups and reference tab in downloaded template |
FO on Edit Activity Modal | Framework Objectives from the same Project should display in the LWC lookups and reference tab in downloaded template |
FO on IP DL Excel | Framework Objectives from the same Project should display in the LWC lookups and reference tab in downloaded template |
Activity on Financial Plan DL Excel | Activities from the same Project should display in the planning template |
Activity on Financial Report DL Excel | Activities from the same Project should display in the reporting template |
Budget on Financial Report DL Excel | Budgets from the same Project should display in the reporting template |
Error Handling
Invalid Filter: An error is raised if the filter conditions are incorrect.
API Errors: Errors occur if any API referenced in the filter is unavailable.
Field Access Issues: If there is no access to a specified field in the filter, it will trigger an error.
LWC Components: If one filter fails, the default values will display, ignoring all other valid filters.
Download/Upload: If one filter fails, the remaining valid filters are still applied to their respective lookups.