KI-157
Account Search throws "Aggregate query" error when restricted to the selected institution
| Created date | 08/19/2026 | Updated date | 10/02/2026 |
|---|---|---|---|
| Status | Done | Related work item | MSS-109, MIC-4883 |
| Description | A person search in Account Search can fail with one of the following errors when Restrict to Selected Institution is selected and a term is typed in the free-text Search box: - Aggregate query has too many rows for direct assignment, use FOR loop - System.LimitException: Too many query rows: 50001 For institutions with fewer affiliated accounts, the search doesn't fail. Instead, it returns unrelated people affiliated with the institution instead of the person searched for. This is a different issue from KI-131, which remains fixed in V16. Searches that leave the free-text Search box empty and use only field filters, such as Last Name, aren't affected. | ||
| Root Cause | When the restriction was selected, Account Search discarded the accounts that matched the search term. Instead, it evaluated every account affiliated with the selected institution, along with each account's Contact Information and Affiliation records. For institutions with many affiliated accounts, this exceeds Salesforce query limits. Both error messages come from the same problem, reached at different data volumes. | ||
| Affects version(s) | V16, V17, V18 | Impacted capabilities | Inquiry Management |
| Steps to reproduce |
| ||
| Workaround | Use either of these workarounds:
| ||
| Fix version | V19 | Resolution notes | A restricted search now returns only accounts that match the search term and are affiliated with the selected institution. For Restrict to Selected Requester, it returns only matches affiliated with the selected requester. The search also completes for large institutions without hitting Salesforce query limits. For details, see the Fall '26 (V19) Release Notes. |
