# Salesforce app: Apex trigger error query on Leads

**URL:** <https://devforum.zoom.us/t/salesforce-app-apex-trigger-error-query-on-leads/36179>\
**Category:** App Marketplace\
**Created:** [November 16, 2020, 11:59pm UTC](https://devforum.zoom.us/t/salesforce-app-apex-trigger-error-query-on-leads/36179 "2020-11-16T23:59:14Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![sti1](https://avatars.discourse-cdn.com/v4/letter/s/a9adbd/32.png) [@sti1](https://devforum.zoom.us/u/sti1)\
**Post date:** [November 16, 2020, 11:59pm UTC](https://devforum.zoom.us/t/salesforce-app-apex-trigger-error-query-on-leads/36179/1 "2020-11-16T23:59:15Z")

</div>

We are using Lightning Sync to sync our user’s calendars to Salesforce. This creates events in Salesforce. A couple of weeks ago we noticed that certain calendar events stopped syncing. With the help of SF support we traced the problem to a trigger from the Zoom app. The trigger is trying to query the Lead object. I was able to apply a quick fix for some of our users with Salesforce licenses by granting Read access on the Lead object, but we have some user licenses that do not support access to Leads, so this is still broken for them and generating errors in our Salesforce org.

We are not using the Lead object in our Salesforce org at all, so there is nothing for the Zoom app to query there.

**Error**  
zoom\_app.ZoomMeetingCreationTrigger : zoom\_app.ZoomMeetingCreationTrigger: execution of AfterInsert caused by: System.QueryException: sObject type ‘lead’ is not supported. If you are attempting to use a custom object, be sure to append the ‘\_\_c’ after the entity name.

**Which App?**  
Salesforce Zoom App

**How To Reproduce (If applicable)**

1. Install Zoom app for Salesforce
2. Enable Lightning/Outlook Sync in Salesforce
3. Notice that the users calendars are missing many events
4. See trigger errors in the log

Thanks for your consideration!  
Sue

---

<div class="post-metadata">

**Author:** ![tommy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tommy/32/72769_2.png) [@tommy](https://devforum.zoom.us/u/tommy)\
**Post date:** [November 17, 2020, 6:39pm UTC](https://devforum.zoom.us/t/salesforce-app-apex-trigger-error-query-on-leads/36179/2 "2020-11-17T18:39:21Z")

</div>

Hey @sti1,

Thanks for reporting this. (ZOOM-218234) Our engineering team is taking a look. I will get back to you with updates. 🙂

-Tommy

---

<div class="post-metadata">

**Author:** ![sti1](https://avatars.discourse-cdn.com/v4/letter/s/a9adbd/32.png) [@sti1](https://devforum.zoom.us/u/sti1)\
**Post date:** [November 17, 2020, 6:53pm UTC](https://devforum.zoom.us/t/salesforce-app-apex-trigger-error-query-on-leads/36179/3 "2020-11-17T18:53:30Z")

</div>

Thanks @tommy! I appreciate it.

-Sue

---

<div class="post-metadata">

**Author:** ![tommy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tommy/32/72769_2.png) [@tommy](https://devforum.zoom.us/u/tommy)\
**Post date:** [November 18, 2020, 5:57pm UTC](https://devforum.zoom.us/t/salesforce-app-apex-trigger-error-query-on-leads/36179/4 "2020-11-18T17:57:34Z")

</div>

Hey @sti1,

Does the Salesforce user you are using have [lead access](https://help.salesforce.com/articleView?id=leads_overview.htm&type=5)? If not, that could be the issue.

> **[Lead access for additional users - Answers - Salesforce Trailblazer Community](https://trailblazers.salesforce.com/answers?id=9063A000000ia03QAA)**

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![sti1](https://avatars.discourse-cdn.com/v4/letter/s/a9adbd/32.png) [@sti1](https://devforum.zoom.us/u/sti1)\
**Post date:** [November 18, 2020, 6:26pm UTC](https://devforum.zoom.us/t/salesforce-app-apex-trigger-error-query-on-leads/36179/5 "2020-11-18T18:26:52Z")

</div>

Hi @tommy,

Yes that is the issue. As I mentioned above, we have a large subset of users who are under a license type that does not support access to Leads. This didn’t matter until just a couple of weeks ago when the trigger starting generating errors. Salesforce made a change in their last release that looks a lot closer at CRUD permissions when it comes to Apex classes, which I’m guessing is when this started.

I don’t mean to presume but my impression is that there is logic in the trigger that could be offloaded to a trigger handler class. Trigger handler classes can be designated “without sharing” which means they would not be dependent upon the CRUD permissions of the logged in user.

Of course I do not have access to the code so could be completely wrong, but that is my impression of what might be causing the error.

Best,  
Sue

---

<div class="post-metadata">

**Author:** ![tommy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tommy/32/72769_2.png) [@tommy](https://devforum.zoom.us/u/tommy)\
**Post date:** [November 19, 2020, 5:40pm UTC](https://devforum.zoom.us/t/salesforce-app-apex-trigger-error-query-on-leads/36179/6 "2020-11-19T17:40:39Z")

</div>

Hey @sti1,

Thanks for sharing these details. As this was a Salesforce change I am not sure how much we can do here, but let me see if we can improve the error messaging or flow.

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![tommy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tommy/32/72769_2.png) [@tommy](https://devforum.zoom.us/u/tommy)\
**Post date:** [November 20, 2020, 5:21pm UTC](https://devforum.zoom.us/t/salesforce-app-apex-trigger-error-query-on-leads/36179/7 "2020-11-20T17:21:07Z")

</div>

Hey @sti1,

Some user licenses do not support access to Leads. Did you mean that the salesforce profile doesn’t have lead read access and when you add that permission, you still can not assign lead access?

If yes, can you try changing the user license?

> **[Can Leads Permission Set be assigned to Standard User Profile with Salesforce...](https://trailblazers.salesforce.com/answers?id=9063A0000019VVHQA2)**

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![sti1](https://avatars.discourse-cdn.com/v4/letter/s/a9adbd/32.png) [@sti1](https://devforum.zoom.us/u/sti1)\
**Post date:** [November 20, 2020, 5:39pm UTC](https://devforum.zoom.us/t/salesforce-app-apex-trigger-error-query-on-leads/36179/8 "2020-11-20T17:39:27Z")

</div>

Hey @tommy

The license type we are using is called Lightning Platform Starter, which does not support access to Leads.

> **[Help | Training | Salesforce](https://help.salesforce.com/articleView?id=users_license_types_communities_lightning_platform_details.htm&type=5)**

We do not have enough regular licenses for all our users and cannot afford to purchase them. (they are a LOT more expensive)

For now I have disabled the Zoom app because we have functionality that relies on the event data. I’m hoping we can work this out - it would be a shame for this to prevent us from using the app when we aren’t even using Leads.

Sue

---

<div class="post-metadata">

**Author:** ![tommy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tommy/32/72769_2.png) [@tommy](https://devforum.zoom.us/u/tommy)\
**Post date:** [November 23, 2020, 9:24pm UTC](https://devforum.zoom.us/t/salesforce-app-apex-trigger-error-query-on-leads/36179/9 "2020-11-23T21:24:18Z")

</div>

Hey @sti1,

Thanks for the info. Let me see if there is a solution to the leads blocked.

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![tommy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tommy/32/72769_2.png) [@tommy](https://devforum.zoom.us/u/tommy)\
**Post date:** [November 25, 2020, 7:11pm UTC](https://devforum.zoom.us/t/salesforce-app-apex-trigger-error-query-on-leads/36179/10 "2020-11-25T19:11:21Z")

</div>

Hey @sti1,

We are going to fix this in one of the upcoming Zoom Salesforce App updates. 🙂

Before we search the lead object ,we are going to add a check to judge whether the user has read access.

Thanks,  
tommy

---

<div class="post-metadata">

**Author:** ![sti1](https://avatars.discourse-cdn.com/v4/letter/s/a9adbd/32.png) [@sti1](https://devforum.zoom.us/u/sti1)\
**Post date:** [November 25, 2020, 7:37pm UTC](https://devforum.zoom.us/t/salesforce-app-apex-trigger-error-query-on-leads/36179/11 "2020-11-25T19:37:18Z")

</div>

Hey @tommy, oh that’s great news! Thanks!!

Sue

---

<div class="post-metadata">

**Author:** ![tommy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tommy/32/72769_2.png) [@tommy](https://devforum.zoom.us/u/tommy)\
**Post date:** [November 30, 2020, 8:14pm UTC](https://devforum.zoom.us/t/salesforce-app-apex-trigger-error-query-on-leads/36179/12 "2020-11-30T20:14:33Z")

</div>

You are welcome! 🙂

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [December 31, 2020, 6:14am UTC](https://devforum.zoom.us/t/salesforce-app-apex-trigger-error-query-on-leads/36179/13 "2020-12-31T06:14:43Z")

</div>

Closed on December 31, 2020, 6:14am UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.

---

<div class="post-metadata">

**Author:** ![tommy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tommy/32/72769_2.png) [@tommy](https://devforum.zoom.us/u/tommy)\
**Post date:** [February 16, 2021, 6:55pm UTC](https://devforum.zoom.us/t/salesforce-app-apex-trigger-error-query-on-leads/36179/14 "2021-02-16T18:55:52Z")

</div>

Hey @sti1 ,

This should be fixed now. Please upgrade to the latest Salesforce Zoom App version and try again. 🙂

Thanks,  
Tommy
