pegros / PEG_LIST

Set of configurable/actionable LWC list components for Salesforce Lightning UX
MIT License
20 stars 9 forks source link

[bug] sfpegActionBarCmp - Filters not applied in form popups for lookup fields #14

Closed pegros closed 2 years ago

pegros commented 2 years ago

Describe the bug When using a unitary or mass form action, lookup fields are properly displayed in the popup but the filter configured on the lookup field is not applied.

To Reproduce Steps to reproduce the behavior: This happens for any LDS or DML unitary or mass form action as soon as a lookup filter is applied. When in unitary LDS edit mode, the filter may be applied based on the original situation of the record. For any mass action or DML form unitary action leveraging creation forms behind the hood, no filter is applied.

Expected behavior The objective is to get a restricted list of records to be selected from when editing a lookup field.

Screenshots N/A

Desktop (please complete the following information): Any

Smartphone (please complete the following information): N/A

Additional context This is actually a restriction of the standard lightning-input-field component. See lookup fields in https://developer.salesforce.com/docs/component-library/bundle/lightning-input-field/documentation

pegros commented 2 years ago

The proposed solution is to add a "dataSource" property to the fields to be displayed in the forms. When such a property is found, the standard lightning-input-field is hidden and a new sfpegPicklistInputDsp component displayed to choose a value out of a lighting-combobox. The list of available values is provided by the dataSource property which should provide the name of a registered sfpegList metadata record.

pegros commented 2 years ago
Capture d’écran 2022-10-14 à 18 05 42
pegros commented 2 years ago

Issue fixed in commit 41a39a0