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

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.

| improve this answer | |
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.

| improve this answer | |
1

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.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.