You need to sign in to do that
Don't have an account?

SOQL against ActivityHistory Object
Hello All,
I am trying to work with the ActivityHistory Object and wanted to confirm what I think the issue is.
I have a query where I want to return records where the record does not contain an activty:
I am assuming that it is not possible to query against the ActivityHistory object correct?
I am trying to work with the ActivityHistory Object and wanted to confirm what I think the issue is.
I have a query where I want to return records where the record does not contain an activty:
Select Id,Name FROM test__c WHERE Status__c='Registered' AND ID NOT IN (SELECT WhatID FROM ActivityHistories where Activity_Subtype__c='stuff')
I am assuming that it is not possible to query against the ActivityHistory object correct?
https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_select_comparisonoperators.htm?search_text=ActivityHistory
ActivityHistory
Attachments
Event
EventAttendee
Note
OpenActivity
Tags (AccountTag, ContactTag, and all other tag objects)
Task
All Answers
Thanks for the reply. The query you supplied will work. What I am trying to do is return records from the test__c object where there IS NOT an Activty associated to it where the activty_subtype__c ''stuff'.
Thanks
https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_select_comparisonoperators.htm?search_text=ActivityHistory
ActivityHistory
Attachments
Event
EventAttendee
Note
OpenActivity
Tags (AccountTag, ContactTag, and all other tag objects)
Task