PEG_LIST icon indicating copy to clipboard operation
PEG_LIST copied to clipboard

[bug] sfpegList_CTL - AggregateResult SObject types are not supported

Open Mchaouche opened this issue 2 years ago • 5 comments

Describe the bug In the sfpegList cmp when we define a SOQL query with AggregateResult and don't bypassFLS in the MDT record, an exception is thrown in the Apex class sfpegList_CTL

To Reproduce Steps to reproduce the behavior:

  1. Go to CMT record
  2. Put a SOQL query with a count for example 3-FATAL_ERROR| System.AuraHandledException: Script-thrown exception is thrown

Expected behavior The list is shown

Additional context

The error is thrown in line 556: SObjectAccessDecision securityDecision = Security.stripInaccessible(AccessType.READABLE, results);

Mchaouche avatar Feb 17 '23 18:02 Mchaouche

@Mchaouche Why cannot you simply bypass FLS for this query ? I would not understand why you would not display all aggregation dimensions in the results, as it would result in possible duplicate lines with same other aggregation values.

pegros avatar Feb 22 '23 15:02 pegros

FYI @jstukas

pegros avatar Feb 22 '23 15:02 pegros

Hello @pegros Yes this is what we've done but i think the code should handle this exception, this is why i logged this issue to let you know, if you did not.

Thanks

Mchaouche avatar May 26 '23 08:05 Mchaouche

I may catch the exception but would then probably return an empty list in such a case. @Mchaouche

pegros avatar May 31 '23 06:05 pegros

FYI, a custom permission may be set on the sfpegList configuration to control who actually has access to the query with bypassFLS activated.

pegros avatar Dec 12 '23 13:12 pegros