When Salesforce is life!

Tag: Activity

[Salesforce] The Sobject Crusade: ActivityHistory

Back to the Sobject Crusade list.

Source: ActivityHistory

The ActivityHistory object is a read-only object that shows all completed Tasks and past Events related to a give object (e.g. Account). It includes activities for all contacts related to the object.

This object is shown in the Activity History related list:

Few limitations apply:

  • The object cannot be queried directly but only queried through inner query (e.g. Select Id, (Select Subject From ActivityHistory) From Account Where Name = ‘ACME bros’)
  • Your main query must reference exactly 1 record
  • Inner query must not have a WHERE clause
  • Inner query must filter a maximum of 500 items

Here is an example query:

SELECT Name, (SELECT ActivityDate, Subject, IsTask FROM ActivityHistories ORDER BY ActivityDate ASC NULLS LAST Limit 500) FROM Account WHERE Name =’ACME Bros’

The Sobject Crusade: AcceptedEventRelation

Back to the Sobject Crusade list.

Source: AcceptedEventRelation

This object is available in API versions 29.0 and later.

The AcceptedEventRelation object the info about invitees who have accepted/refused the event.

How to get to it?

Go to an object standard layout where the Open Activities related list is available:

Click on New Event:

On the bottom click “Add Invitees” to add another User to the event.

Save the event.

The users you have invited will see the event in their calendar home page component, and by clicking on the Event subject they can accept/decline the invitation (by clicking the Accept Event or Decline Event buttons):

You will see the new status on the “Accepted” or “Declined” related list of the new event:

Now you have all you need to query this info:

Here is the SOQL to query the object:

SELECT eventId, relationid, type, response, RespondedDate FROM AcceptedEventRelation WHERE eventid=’00U24000002HD19′

Powered by WordPress & Theme by Anders Norén