Idea Summary
One of the most commonly reported issues in our APEX applications is that users want LOVs to be restricted to ‘active’ records during the selection process, but the LOV should be able to display the selected value even if that value is no longer ‘active’ in the source SQL.
Use Case
We use Popup-LOV controls to select employee names, projects, etc. in a multitude of pages and applications, we store the ID of the selected name or project. Users want the ‘select’ list to be limited to active employees/projects only to keep the list short. However, if we filter the LOV source for ‘active’ employees only, it becomes impossible for the LOV control to display the names of employees that have become ‘inactive’ after the name was referenced. Therefore, the best we can do is list all records, active or not, and provide a validation during the save process to ensure only ‘active’ records were selected.
Preferred Solution (Optional)
The LOV (Shared Components) could provide an additional, optional SQL source box for the display purpose. This optional SQL would typically perform the same SELECT as the normal LOV source SQL, but without the where clause so that the display lookup does not fail if the where clause is no longer met. Although the normal LOV source can define multiple columns, the additional display SQL only needs to define a display and return column since it will only be used for dereferencing existing key values, not to pick new values.
i.e. normal LOV source: SELECT employee d, emp_id r FROM employees WHERE active = ‘Y’
i.e. display LOV source: SELECT employee d, emp_id r FROM employees