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
Interfaces DivaltoInterfaces Divalto 

Event not found via SOQL despite it's displayed on Salesforce

Hello salesforce developpers!

I have an understanding issue with events/activities in Salesforce: I must insert event data in salesforce from an ERP using Talend.

During Talend insertion, I see the processed IDs in the logs. When searching for this ID by typing "https://eu5.salesforce.com/<ID>", I see the corresponding event and all its details. Seems fine.

However, when searching in developper console (SOQL) like this:
Select Id, Subject from event where Id = '<ID>'

... No event found.

Could someone explain to me why I do not see the event in console? is it stored in another table? (i've also searched in Activity table without much success).

Best regards, and thanks in advance!
Apoorv Saxena 4Apoorv Saxena 4
Hi,

After executing your query in Developer Console, please click on 'Refresh Grid' button there.(See screenshot)

User-added image

Please let me know how this works for you, mark this as Solved if this helps you so that others can view it as a proper solution.

Thanks,
​Apoorv
 
Interfaces DivaltoInterfaces Divalto
Hi Apoorv,

Thanks for your reply.
I have tried to click on 'Refresh Grid' button, however there is still no data. ("Query Results - Total Rows: 0")
For information, the data has been inserted several weeks ago, and is still visible in the Salesforce GUI.

Are the ID in the URL and the ID in the event table not the same maybe?

Regards
Apoorv Saxena 4Apoorv Saxena 4
Hi,

Could you please share a screenshot of an Event open in your salesforce instance and SOQL for the same, so that I might be able to resolve this issue.
Interfaces DivaltoInterfaces Divalto
Here is the two requested screenshots:

The one on the GUI where we can see the ID in the URL:
GUI screenshot

And the one in the dev console:
console Screenshot
Apoorv Saxena 4Apoorv Saxena 4
Hi,

That's strange. Seems like some kind of a bug.

Try changing filter criteria, something like :

Select id,subject from event where subject like '%A%'

Let me know how it works out for you.
Interfaces DivaltoInterfaces Divalto
I've tried with Select id, subject from event where subject like 'Action%' to have less results (as the subject of my example is "Action à mener")

I've some data (95 lines), however the corresponding ID (00U24000009mX38) is not there. Don't know if it helps, but there is some IDs that are similar but the end is different (like 00U24000009mXH9EAM , 00U24000009mXI2EAM ...).

 
Interfaces DivaltoInterfaces Divalto

Up!
I'm still stuck on this problem.
Any help to understand why Events IDs are not found in the event table? Am I missing something?

best regards

RyanCoxRyanCox
Did you ever figure this out? I'm seeing the same behavior when I execute SOQL from an apex class. Non-repeating Events showing on the calendar are returned from my query, but repeating Events are ignored. 
Tom LinsteadTom Linstead

I was having a similar problem with my Visualforce page. It turns out because the page and controller where using an older API version prior to the release of Lightning repeating Tasks/Events they were not being returned in the query. 

Simply updating the API version (e.g to 46) on both the visualforce page and apex controller resolved the issue and now the query is returning the repeating events. 

Andy MilkovicAndy Milkovic
I also had this issue and found out that Salesforce archives Events over 365 days old so they are not available via SOQL after that (unless using QueryAll).

You can increase this time frame limit through support if needed: https://help.salesforce.com/articleView?id=000328570&language=en_US&type=1&mode=1
Sravanthi M 14Sravanthi M 14
@Tom Linstead It worked for me. Thanks!