function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Zander ZumbrunnenZander Zumbrunnen 

Query All Events

Hello,

I ran into a permission issue with Events.
As a system admin, I am able to query for all Events, but I need to give others users the same permission.
I built a custom scheduling component and it requires the scheduler to query all the events for the person they are trying to schedule.
I have looked in the profile settings but I can't seem to find anything that fixes the issue.
Is there some hidden setting I do not know about?
As a work around, I changed the apex class the public without sharing so it ignores permissions, but I still would like to know if there is a system/profile/user setting somewhere that would give them access.

Thanks in advance!

(Putting this under Apex Code Development since I don't seem to see a Administrative section)
Sai PraveenSai Praveen (Salesforce Developers) 
Hi Zander,

I guess the OWD for the activities is set to private in your org because of it other users are not able to query all the events. In the below provided link we have different scenerios how to set the access to activities (Event and task).
https://www.simplysfdc.com/2015/01/salesforce-activity-controlled-by-parent.html
Hope above information was helpful.

If this information helps, Please mark the answer as best.

Thanks.
Zander ZumbrunnenZander Zumbrunnen
Hi Sai,

That was one place I checked and we have it set to Controlled by Parent.

User-added image

And since these events are related to accounts, I made sure that they can see all accounts which they can.

User-added image

I went down the list of permissions in the article you provieded (Thank you), but it seems like they already had all the permissions covered.
Activity sharing rule set as Controlled by Parent.
Access to view all accounts.
Access Activities is true.
Edit Events and Edit Tasks are both true.
We do not use hierarchies so I do not think that applies.

The only one that was not true was View All Data which is something that would give too much access.

Is that the one thing preventing them from querying other user's events?

Thank you.