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
hvennam1.3968892315509075E12hvennam1.3968892315509075E12 

SOQL query to relate Events and custom Object

Hi,

OBjects:
1.EVENTS
2.CUSTOM_OBJECT__c

I am trying to write a soql query to relate Events Object And Custom Object.

Query I Have written:
ev = [select id,what.id,what.type,IsRecurrence,RecurrenceEndDateOnly  from Event where 
     WhatId = :pu.id
    AND What.Type = 'CUSTOM_OBJECT__c' ];

Problem:
It is creating event but not relating that event to that custom object.Pls help me with the query to relate this.

Correct me If i am writing the query in wrong way.

Thanks,
PrasanntaPrasannta (Salesforce Developers) 
Hi,

Please refer to this link below-

https://developer.salesforce.com/forums?id=906F00000008qROIAY

Hope it helps.
ScualScual
2014... for everybody
Select Id,(Select Id From ActivityHistories where IsTask=false ),(Select Id From OpenActivities where  IsTask=false) from test__c