I am getting the following error when I run s Salesforce SOQL query with a standard account.
Query:
SELECT ( SELECT Id, Subject FROM OpenActivities ORDER BY ActivityDate
ASC , LastModifiedDate DESC LIMIT 500) FROM Account WHERE Id in (
'001b0000009owSN', '001b0000009owNo' )
Results:
MALFORMED_QUERY: Implementation restriction: activity aggregate relationships only allow security evaluation for non-admin users when a single parent record is evaluated
Same query under Admin account works well.
Similar query works well under Standard account:
SELECT ( SELECT Id, Name FROM Contacts ORDER BY Email ASC LIMIT 500)
FROM Account WHERE Id in ( '001b0000009owSN', '001b0000009owNo' )
How can the problematic query be re-written? Why does that limitation exists?
Thanks,