[feat] sfpegKpiListCmp - Fetch KPI values from Apex instead of LDS
Is your feature request related to a problem? For home/app pages without record context or for KPIs too complex to pre-compute on the records, it would be great to be able to invoke an Apex method to fetch KPI values instead of relying exclusively on Lightning Data Service to fetch them.
Describe the solution you'd like The objective is still to preferably leverage KPI record fields but support also custom Apex ways to fetch KPI values. Ideally, a basic SOQL count() based mechanism would be nice to avoid coding custom Apex classes. When calling Apex, it is key to provide contextual information about the current record (at least objectApiName and recordId) but leveraging the sfpegMergeUtl feature might simplify implementation of simple SOQL query based solution (and optimise performances).
Describe alternatives you've considered
In order to minimise impacts on the component, an option would be to implement a separate Context loading feature relying
on an Apex class (implementing a common virtual class) and provide contextName instead of name / fieldName
properties to provide information for values.
Additional context KPI list component in legacy Aura PEG package enabled to display custom KPIs based on SOQL queries. This approach was abandoned in LWC (and replaced by KPI LDS retrieval) mainly for performance reasons. Introducing the Apex retrieval feature should not impact performances too much (usage of Apex continuation? split of LDS vs Apex KPI retrieval to avoid blocking rendering ?).