OpenActivity

This read-only object contains all open tasks and events associated with an object. OpenActivity fields related to calls are only available with Salesforce CRM Call Center.

Supported Calls

describeGlobal(), describeSObject(), describeSObjects()

Fields

Field Field Type Field Properties Description
ActivityDate date

Filter

Nillable

The due date of the task, or for an activity, then the due date if IsAllDayEvent is set to true.

This field has a timestamp that is always set to midnight in the Coordinated Universal Time (UTC) time zone. The timestamp is not relevant; do not attempt to alter it in order to accommodate time zone differences. Label is Date.

ActivityType picklist

Filter

Nillable

One of the following values: Call, Meeting, or Other. Label is Type.
CallDisposition string

Filter

Nillable

Represents the result of a given call, for example, “we'll call back,” or “call unsuccessful.” Limit is 255 characters.

CallDurationInSeconds int

Filter

Nillable

Duration of the call in seconds.

CallObject string

Filter

Nillable

Name of a call center. Limit is 255 characters.

CallType picklist

Filter

Nillable

The type of call being answered: Inbound, Internal, or Outbound.

Description textarea Nillable Description of the task or event. Limit is 32 KB.
DurationInMinutes int Filter

Nillable

Length of the event or task.
IsAllDayEvent boolean

Defaulted on create

Filter

If true, the activity is an event and the ActivityDate is used to define the date of the event. If false, the activity may be a task or an event. Label is All Day Event.
IsClosed boolean Defaulted on create

Filter

For tasks only, indicates whether the task was completed (true) or not (false). This field is set indirectly by setting the Status field--each picklist value has a corresponding IsClosed value. Label is Closed.
IsDeleted boolean Defaulted on create

Filter

Indicates whether the record has been moved to the Recycle Bin (true) or not (false). Label is Deleted.
IsTask boolean

Defaulted on create

Filter

If true, the activity is a task, if false, it is an event. Label is Task.
IsVisibleInSelfService boolean

Defaulted on create

Filter

If true, the activity can be viewed in the self-service portal. Label is Visible in Self-Service.
Location string

Filter

Nillable

If an event, the location of the event. If not, the value is null.
OwnerId reference

Filter

Nillable

ID of the user who owns the task or event.
Priority picklist Filter

Nillable

If a task, the importance of the task, such as high, normal, or low.
Status picklist Filter

Nillable

For tasks, the current status of the task, for example In Progress or Complete. Each predefined Status field sets a value for IsClosed. To obtain picklist values, you can query() on the TaskStatus object.
Subject combobox

Filter

Nillable

Subject line of the task or event.
WhatId reference

Filter

Nillable

ID of the related object (Account, Campaign, Case, Opportunity, or custom object). Label is Opportunity/Account ID.
WhoId reference

Filter

Nillable

ID of the related Contact or Lead. If WhoId refers to a lead, then the WhatId field must be empty. Label is Contact/Lead ID.

Usage

This object helps you replicate the related list functionality of the Salesforce.com user interface. To use this object, use the following procedure:
  1. Optionally, issue a describe call against the object whose activities you wish to query, to get a suggestion of the correct SOQL to use.
  2. Issue a SOQL relationship query with a main clause that references the object, and an inner clause that references the activity history, for example:
    SELECT (SELECT ActivityDate, Description from ActivityHistories) FROM Account WHERE Name Like 'XYZ%'
    
    or
    SELECT (SELECT ActivityDate, Description from OpenActivities) FROM Account WHERE Name Like 'XYZ%'

The Salesforce.com user interface enforces sharing rules, filtering out related list items that a user does not have permission to see.

In order to prevent performance issues while still providing the related list functionality, there are some restrictions on users who do not have “View All Data” permission. Such users must comply with the following restrictions:
  • In the main clause of the relationship query, you can reference only one record. For example, you cannot filter on all records where the account name starts with A, but must reference a single account record.
  • You cannot use WHERE clauses.
  • You must specify a limit to the number of rows returned, less than 500.
  • You must sort on ActivityDate and LastModifiedDate, descending order: ORDER BY ActivityDate DESC, LastModifiedDate DESC

You cannot use query() directly on this object.

© Copyright 2000-2010 salesforce.com, inc. All rights reserved.
Various trademarks held by their respective owners.