3

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!

3 Answers 3

3

It'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.

2

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.

1

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .