I'm trying to get SOQL's for Activities (workbench was no help).
I'm looking at the three prebuilt reports in Salesforce:
Activities on Leads,
Activities on Accounts, and
Activities on Opportunitites
and would like to see "open & completed activites", both "Events & Tasks", as well as a date frame for Activity Date in THIS_YEAR.
My best guess are for eg 'Activities on Leads' is:
SELECT Report_Country_L__c, (SELECT Owner.Name,ActivityDate,Status,istask,TaskSubtype, Subject FROM Task WHERE ActivityDate = This_Year) FROM Lead
But it does not work!