1

I have enabled the Shield Platform Encryption and encrypted the BillingAddress field of the Account sobject.

When checking the describe field result of the BillingCountry (sub-field of the BillingAddress field), it returns false.

I tried to use the GROUP BY clause for this field, and it was successful without any exceptions. It seems to conflict with the Salesforce document.

isGroupable()

Returns true if the field can be included in the GROUP BY clause of a SOQL query, false otherwise. This method is only available for Apex classes and triggers saved using API version 18.0 and higher.

Do you have any documents or issues related to this that I can explain to my customers?

Thank you,

Code sample:

Schema.DescribeFieldResult dfr = Account.BillingCountry.getDescribe();
System.debug('isGroupable: ' + dfr.isGroupable()); // --> return false

List<AggregateResult> aggregateResults = [
SELECT BillingCountry,SUM(AnnualRevenue) 
FROM Account 
GROUP BY BillingCountry ]; // --> no exception
System.debug('group success');
System.debug('aggregateResults size: ' + aggregateResults.size()); // --> return size > 0
12
  • 1
    @SaiPraveenKakkirala Did you encrypted the BillingAddress field? In my org, this field isGroupable as false
    – totaki
    Commented Nov 30, 2022 at 4:47
  • 1
    > As per the document if you encrypt Billing Address encrypts Billing Street and Billing City and encrypted fields are not Groupable I read this document, but I don't know why they are false when checking the isGroupable by Apex code for BillingCountry and BillingState. And I am able to group them as well. ![enter image description here](i.sstatic.net/8tw4O.png)
    – totaki
    Commented Nov 30, 2022 at 6:16
  • 1
    @PhilW can we log this bug for Salesforce?
    – totaki
    Commented Dec 1, 2022 at 7:54
  • 1
    @trong.nsy, Thanks for sharing it . I will follow up on this internally and get back to you. Can you share Case number instead of Caseid Commented Dec 1, 2022 at 9:42
  • 1
    @SaiPraveenKakkirala The case number is 43707765. Thanks!
    – totaki
    Commented Dec 2, 2022 at 2:21

1 Answer 1

0

Thanks for bringing up the issue and waiting on the case. As per the investigation by our internal team this is logged as a bug (W-12208951).

Account.BillingCountry getting isGroupable as false though the same can be used in SOQL without any exception

A known issue is also been created for the same.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .