When looking at schema builder we see an object Activity. But when I tried to query it, 'entity type Activity does not support query' error is received. What is the purpose of this table and how is it important?
Thanks in advance for your time!
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It only takes a minute to sign up.
Sign up to join this communityIt's the parent "SObject" type that represents Task
and Event
. It appears only in relationship queries, such as:
SELECT Id, (SELECT Id, Subject, ActivityDate FROM ActivityHistories)
FROM Account
Of course, this is only a convenience object, because it really represents two distinct objects, and only serves a purpose in queries to collapse both tasks and events into ActivityHistories or OpenActivities.
Activity
is a kind of a logical object in salesforce. Real concrete types are Task
and Event
. You can query on those two types, which are under Activity
in Setup > Customize > Activities.
For a related note on Salesforce have a look at here.
The activity table is really two tables, tasks and events, with similar shared functionality but also differences. So you would really want to query Task or Event, but not Activity.