---
schema_version: "1"
id: ed950c4b9aa176fad8cce2e6cfda784676acd1fe521ee3c0ee2de249ad69ea51
title: OpenActivity
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/object_reference/sforce_api_objects_openactivity.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_openactivity.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 9185abb80d1e7c4108b86a5bf64a5674cae6e48135a98cb5784f4c492568f828
description: This read-only object is displayed in a related list of open activities—future events and open tasks—related to an object. It includes activities for all contacts related to the object. OpenActivity fields for phone calls are only available if your organization uses Salesforce CRM Call Center.
---
# OpenActivity

This read-only object is displayed in a related list of open activities—future events and open tasks—related to an object. It includes activities for all contacts related to the object. OpenActivity fields for phone calls are only available if your organization uses Salesforce CRM Call Center.

## Supported Calls

describeSObjects()

## Fields

<table class="featureTable sort_table" summary="">


          <thead class="thead sorted" align="left">
            <tr>
              <th class="featureTableHeader  " id="d1331485e67">Field</th>

              <th class="featureTableHeader  " id="d1331485e70">Details</th>

            </tr>

          </thead>

          <tbody class="tbody">
            <tr>
              <td class="entry" headers="d1331485e67" data-title="Field"><span class="keyword parmname">AccountId</span></td>

              <td class="entry" headers="d1331485e70" data-title="Details">
                <dl class="dl detailList">

                  <dt class="dt dlterm">Type</dt>

                  <dd class="dd">reference</dd>



                  <dt class="dt dlterm">Properties</dt>

                  <dd class="dd">Filter, Group, Nillable, Sort</dd>



                  <dt class="dt dlterm">Description</dt>

                  <dd class="dd">Indicates the ID of the
                    related account, which is determined as follows:<ul class="ul bulletList">
                      <li class="li">The account associated with the <span class="keyword parmname">WhatId</span>, if it exists; or</li>

                      <li class="li">The account associated with the <span class="keyword parmname">WhoId</span>, if it exists;
                        otherwise</li>

                      <li class="li"><samp class="codeph nolang">null</samp></li>

                    </ul>
                  </dd>

                  <dd class="dd">This is a relationship field.</dd>



                  <dt class="dt dlterm">Relationship Name</dt>

                  <dd class="dd">Account</dd>



                  <dt class="dt dlterm">Relationship Type</dt>

                  <dd class="dd">Lookup</dd>



                  <dt class="dt dlterm">Refers To</dt>

                  <dd class="dd">Account</dd>


                </dl>

              </td>

            </tr>

            <tr>
              <td class="entry" headers="d1331485e67" data-title="Field"><span class="keyword parmname" id="activitydate"><a name="activitydate"><!-- --></a>ActivityDate</span></td>

              <td class="entry" headers="d1331485e70" data-title="Details">
                <dl class="dl detailList">

                  <dt class="dt dlterm">Type</dt>

                  <dd class="dd">date</dd>



                  <dt class="dt dlterm">Properties</dt>

                  <dd class="dd">Filter, Group, Nillable, Sort</dd>



                  <dt class="dt dlterm">Description</dt>

                  <dd class="dd">Indicates one of the following:<ul class="ul bulletList">
                      <li class="li">The due date of a task</li>

                      <li class="li">The date of an event if <span class="keyword parmname">IsAllDayEvent</span> is set to <samp class="codeph nolang">true</samp>
                      </li>

                    </ul>
                    <p class="p">This field has a time stamp that is always set to midnight in the Universal Time
                      Coordinated (UTC) time zone. The time stamp doesn’t represent the time of the
                      activity; don’t attempt to alter it to accommodate time zone differences. Label
                      is <span class="keyword parmname">Date</span>.</p>
                  </dd>


                </dl>

              </td>

            </tr>

            <tr>
              <td class="entry" headers="d1331485e67" data-title="Field"><span class="keyword parmname">ActivityDateTime</span></td>

              <td class="entry" headers="d1331485e70" data-title="Details">
                <dl class="dl detailList">

                  <dt class="dt dlterm">Type</dt>

                  <dd class="dd">dateTime</dd>



                  <dt class="dt dlterm">Properties</dt>

                  <dd class="dd">Aggregate, Filter, Nillable, Sort</dd>



                  <dt class="dt dlterm">Description</dt>

                  <dd class="dd">Contains the event’s due date if the <span class="keyword parmname">IsAllDayEvent</span> flag is set to
                    <samp class="codeph nolang">false</samp>. <span class="ph" id="date_time_field_info"><a name="date_time_field_info"><!-- --></a> The time
                      portion of this field is always transferred in the Coordinated Universal Time (UTC) time
                      zone. Translate the time portion to or from a local time zone for the user or the
                      application, as appropriate.</span> Label is <strong class="ph uicontrol">Due Date Time</strong>.<p class="p">The
                      value for this field and <span class="keyword parmname">StartDateTime</span> must match, or one of them
                      must be <samp class="codeph nolang">null</samp>.</p>
                  </dd>


                </dl>

              </td>

            </tr>

            <tr>
              <td class="entry" headers="d1331485e67" data-title="Field"><span class="keyword parmname">ActivitySubtype</span></td>

              <td class="entry" headers="d1331485e70" data-title="Details">
                <dl class="dl detailList">

                  <dt class="dt dlterm">Type</dt>

                  <dd class="dd">picklist</dd>



                  <dt class="dt dlterm">Properties</dt>

                  <dd class="dd">Filter, Group, Nillable, Restricted picklist, Sort</dd>



                  <dt class="dt dlterm">
                    <a name="activitysubtype_dlentry"><!-- --></a>Description
                  </dt>

                  <dd class="dd">
                    <span class="ph" id="activitsubtype_desc"><a name="activitsubtype_desc"><!-- --></a>Provides standard subtypes to facilitate creating and
                      searching for specific activity subtypes. This field isn’t updateable.</span>
                    <div class="p">Possible
                      values are:<ul class="ul bulletList">
                        <li class="li">Task</li>

                        <li class="li">Email</li>

                        <li class="li">Call</li>

                        <li class="li">Event</li>

                        <li class="li">LinkedIn —Available in API version 56.0 and later.</li>

                        <li class="li">List Email</li>

                      </ul>
                    </div>
                  </dd>


                </dl>

              </td>

            </tr>

            <tr>
              <td class="entry" headers="d1331485e67" data-title="Field"><span class="keyword parmname">ActivityType</span></td>

              <td class="entry" headers="d1331485e70" data-title="Details">
                <dl class="dl detailList">

                  <dt class="dt dlterm">Type</dt>

                  <dd class="dd">picklist</dd>



                  <dt class="dt dlterm">Properties</dt>

                  <dd class="dd">Filter, Group, Nillable, Sort</dd>



                  <dt class="dt dlterm">Description</dt>

                  <dd class="dd">Represents one of the following values: <samp class="codeph nolang">Call</samp>,
                    <samp class="codeph nolang">Email</samp>, <samp class="codeph nolang">Meeting</samp>, or <samp class="codeph nolang">Other</samp>. Label is
                    <span class="keyword parmname">Type</span>. These are default values, and can be changed.
                  </dd>


                </dl>

                <p class="p"><span class="keyword parmname">ActivityType</span> is the union of <span class="keyword parmname">TaskType</span> and
                  <span class="keyword parmname">EventType</span>. If the same activity appears in both dynamic picklists,
                  duplicate activities appear.
                </p>

                <p class="p"><span class="keyword parmname">TaskType</span> and <span class="keyword parmname">EventType</span> can each have a <samp class="codeph nolang">Call</samp> type. Internally, they are distinct from each other.</p>

              </td>

            </tr>

            <tr>
              <td class="entry" headers="d1331485e67" data-title="Field"><span class="keyword parmname">AlternateDetailId</span></td>

              <td class="entry" headers="d1331485e70" data-title="Details">
                <dl class="dl detailList">

                  <dt class="dt dlterm">Type</dt>

                  <dd class="dd">reference</dd>



                  <dt class="dt dlterm">Properties</dt>

                  <dd class="dd">Filter, Group, Nillable, Sort</dd>



                  <dt class="dt dlterm">Description</dt>

                  <dd class="dd">The ID of a record the activity is related to which contains more details about the
                    activity. For example, an activity can be related to an <a class="xref" href="https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_emailmessage.htm" title="Represents an email in Salesforce.">EmailMessage</a> record.</dd>

                  <dd class="dd">This is a relationship field.</dd>



                  <dt class="dt dlterm">Relationship Name</dt>

                  <dd class="dd">AlternateDetail</dd>



                  <dt class="dt dlterm">Relationship Type</dt>

                  <dd class="dd">Lookup</dd>



                  <dt class="dt dlterm">Refers To</dt>

                  <dd class="dd">EmailMessage</dd>


                </dl>

              </td>

            </tr>

            <tr>
              <td class="entry" headers="d1331485e67" data-title="Field"><span class="keyword parmname">CallDisposition</span></td>

              <td class="entry" headers="d1331485e70" data-title="Details">
                <dl class="dl detailList">

                  <dt class="dt dlterm">Type</dt>

                  <dd class="dd">string</dd>



                  <dt class="dt dlterm">Properties</dt>

                  <dd class="dd">Filter, Group, Nillable, Sort</dd>



                  <dt class="dt dlterm">Description</dt>

                  <dd class="dd">
                    <p class="p">Represents the result of a given call, for example, “we'll call back,” or “call
                      unsuccessful.” Limit is 255 characters. </p>

                  </dd>


                </dl>

              </td>

            </tr>

            <tr>
              <td class="entry" headers="d1331485e67" data-title="Field"><span class="keyword parmname">CallDurationInSeconds</span></td>

              <td class="entry" headers="d1331485e70" data-title="Details">
                <dl class="dl detailList">

                  <dt class="dt dlterm">Type</dt>

                  <dd class="dd">int</dd>



                  <dt class="dt dlterm">Properties</dt>

                  <dd class="dd">Filter, Group, Nillable, Sort</dd>



                  <dt class="dt dlterm">Description</dt>

                  <dd class="dd">
                    <p class="p">Duration of the call in seconds.</p>

                  </dd>


                </dl>

              </td>

            </tr>

            <tr>
              <td class="entry" headers="d1331485e67" data-title="Field"><span class="keyword parmname">CallObject</span></td>

              <td class="entry" headers="d1331485e70" data-title="Details">
                <dl class="dl detailList">

                  <dt class="dt dlterm">Type</dt>

                  <dd class="dd">string</dd>



                  <dt class="dt dlterm">Properties</dt>

                  <dd class="dd">Filter, Group,Nillable, Sort</dd>



                  <dt class="dt dlterm">Description</dt>

                  <dd class="dd">
                    <p class="p">Name of a call center. Limit is 255 characters.</p>

                  </dd>


                </dl>

              </td>

            </tr>

            <tr>
              <td class="entry" headers="d1331485e67" data-title="Field"><span class="keyword parmname">CallType</span></td>

              <td class="entry" headers="d1331485e70" data-title="Details">
                <dl class="dl detailList">

                  <dt class="dt dlterm">Type</dt>

                  <dd class="dd">picklist</dd>



                  <dt class="dt dlterm">Properties</dt>

                  <dd class="dd">Filter, Group, Nillable, Restricted picklist, Sort</dd>



                  <dt class="dt dlterm">Description</dt>

                  <dd class="dd">
                    <p class="p">The type of call being answered: Inbound, Internal, or Outbound.</p>

                  </dd>


                </dl>

              </td>

            </tr>

            <tr>
              <td class="entry" headers="d1331485e67" data-title="Field"><span class="keyword parmname">CompletedDateTime</span></td>

              <td class="entry" headers="d1331485e70" data-title="Details">
                <dl class="dl detailList">

                  <dt class="dt dlterm">Type</dt>

                  <dd class="dd">dateTime</dd>



                  <dt class="dt dlterm">Properties</dt>

                  <dd class="dd">Filter, Nillable, Sort</dd>



                  <dt class="dt dlterm">Description</dt>

                  <dd class="dd">The date and time the task was saved with a Closed status. This value is always
                    null.</dd>


                </dl>

              </td>

            </tr>

            <tr>
              <td class="entry" headers="d1331485e67" data-title="Field"><span class="keyword parmname">ConnectionReceivedId</span></td>

              <td class="entry" headers="d1331485e70" data-title="Details">
                <dl class="dl detailList">

                  <dt class="dt dlterm">Type</dt>

                  <dd class="dd">reference</dd>



                  <dt class="dt dlterm">Properties</dt>

                  <dd class="dd">Filter, Group, Nillable, Sort</dd>



                  <dt class="dt dlterm">Description</dt>

                  <dd class="dd"><span class="ph" id="conn_recvdid_desc"><a name="conn_recvdid_desc"><!-- --></a>Indicates the ID of the PartnerNetworkConnection that shared this record with your organization. This field is available only if your
                      organization has enabled Salesforce to Salesforce and only in API versions 28.0 and
                      later.</span></dd>


                </dl>

              </td>

            </tr>

            <tr>
              <td class="entry" headers="d1331485e67" data-title="Field"><span class="keyword parmname">ConnectionSentId</span></td>

              <td class="entry" headers="d1331485e70" data-title="Details">
                <dl class="dl detailList">

                  <dt class="dt dlterm">Type</dt>

                  <dd class="dd">reference</dd>



                  <dt class="dt dlterm">Properties</dt>

                  <dd class="dd">Filter, Group, Nillable, Sort</dd>



                  <dt class="dt dlterm">Description</dt>

                  <dd class="dd"><span class="ph" id="conn_sentid_desc"><a name="conn_sentid_desc"><!-- --></a>Indicates the ID of the PartnerNetworkConnection that your
                      organization shared this record with. This field is available only if your organization
                      has enabled Salesforce to Salesforce, and only in API versions 28.0 and later. The value
                      is always <samp class="codeph nolang">null</samp>. You can use the
                      PartnerNetworkRecordConnection object to forward records to connections.</span></dd>


                </dl>

              </td>

            </tr>

            <tr>
              <td class="entry" headers="d1331485e67" data-title="Field"><span class="keyword parmname">Description</span></td>

              <td class="entry" headers="d1331485e70" data-title="Details">
                <dl class="dl detailList">

                  <dt class="dt dlterm">Type</dt>

                  <dd class="dd">textarea</dd>



                  <dt class="dt dlterm">Properties</dt>

                  <dd class="dd">Nillable</dd>



                  <dt class="dt dlterm">Description</dt>

                  <dd class="dd">Contains a description of the event or task. Limit is 32 KB.</dd>


                </dl>

              </td>

            </tr>

            <tr>
              <td class="entry" headers="d1331485e67" data-title="Field"><span class="keyword parmname">DurationInMinutes</span></td>

              <td class="entry" headers="d1331485e70" data-title="Details">
                <dl class="dl detailList">

                  <dt class="dt dlterm">Type</dt>

                  <dd class="dd">int</dd>



                  <dt class="dt dlterm">Properties</dt>

                  <dd class="dd">Filter, Group, Nillable, Sort</dd>



                  <dt class="dt dlterm">Description</dt>

                  <dd class="dd">Indicates the duration of the event or task.</dd>


                </dl>

              </td>

            </tr>

            <tr>
              <td class="entry" headers="d1331485e67" data-title="Field"><span class="keyword parmname">EndDateTime</span></td>

              <td class="entry" headers="d1331485e70" data-title="Details">
                <dl class="dl detailList">

                  <dt class="dt dlterm">Type</dt>

                  <dd class="dd">dateTime</dd>



                  <dt class="dt dlterm">Properties</dt>

                  <dd class="dd">Filter, Nillable, Sort</dd>



                  <dt class="dt dlterm">Description</dt>

                  <dd class="dd">Indicates the end date and time of the event or task. Available in versions 27.0 and
                    later. This field is optional, depending on the following:<a name="DurationConditions"><!-- --></a>
                    <ul class="ul bulletList" id="DurationConditions">
                      <li class="li">If <span class="keyword parmname">IsAllDayEvent</span> is true, you can supply a value for either
                        <span class="keyword parmname">DurationInMinutes</span> or <span class="keyword parmname">EndDateTime</span>. Supplying
                        values in both fields is allowed if the values add up to the same amount of time. If
                        both fields are <samp class="codeph nolang">null</samp>, the duration defaults to one
                        day.
                      </li>

                      <li class="li">If <span class="keyword parmname">IsAllDayEvent</span> is false, a value must be supplied for either
                        <span class="keyword parmname">DurationInMinutes</span> or <span class="keyword parmname">EndDateTime</span>. Supplying
                        values in both fields is allowed if the values add up to the same amount of time.
                      </li>

                    </ul>
                  </dd>


                </dl>

              </td>

            </tr>

            <tr>
              <td class="entry" headers="d1331485e67" data-title="Field"><span class="keyword parmname" id="i1455026"><a name="i1455026"><!-- --></a>IsAllDayEvent</span></td>

              <td class="entry" headers="d1331485e70" data-title="Details">
                <dl class="dl detailList">

                  <dt class="dt dlterm">Type</dt>

                  <dd class="dd">boolean</dd>



                  <dt class="dt dlterm">Properties</dt>

                  <dd class="dd">Defaulted on create, Filter, Group, Sort</dd>



                  <dt class="dt dlterm">Description</dt>

                  <dd class="dd">If the value of this field is set to <samp class="codeph nolang">true</samp>, then
                    the activity is an event spanning a full day, and the <span class="keyword parmname">ActivityDate</span>
                    defines the date of the event. If the value of this field is set to <samp class="codeph nolang">false</samp>, then the activity may be an event spanning less than
                    a full day, or it may be a task. The default value of this field is <samp class="codeph nolang">false</samp>. Label is <span class="keyword parmname">All-Day Event</span>.</dd>


                </dl>

              </td>

            </tr>

            <tr>
              <td class="entry" headers="d1331485e67" data-title="Field"><span class="keyword parmname" id="i1455045"><a name="i1455045"><!-- --></a>IsClosed</span></td>

              <td class="entry" headers="d1331485e70" data-title="Details">
                <dl class="dl detailList">

                  <dt class="dt dlterm">Type</dt>

                  <dd class="dd">boolean</dd>



                  <dt class="dt dlterm">Properties</dt>

                  <dd class="dd">Defaulted on create, Filter, Group, Sort</dd>



                  <dt class="dt dlterm">Description</dt>

                  <dd class="dd">Indicates whether a task is closed (<samp class="codeph nolang">true</samp>) or not
                    closed (<samp class="codeph nolang">false</samp>). The default value of this field is
                    <samp class="codeph nolang">false</samp>. This field is set indirectly by setting
                    <span class="keyword parmname">Status</span> on the task—each picklist value has a corresponding <samp class="codeph nolang">IsClosed</samp> value. Label is <span class="keyword parmname">Closed</span>.
                  </dd>


                </dl>

              </td>

            </tr>

            <tr>
              <td class="entry" headers="d1331485e67" data-title="Field"><span class="keyword parmname">IsDeleted</span></td>

              <td class="entry" headers="d1331485e70" data-title="Details">
                <dl class="dl detailList">

                  <dt class="dt dlterm">Type</dt>

                  <dd class="dd">boolean</dd>



                  <dt class="dt dlterm">Properties</dt>

                  <dd class="dd">Defaulted on create, Filter</dd>



                  <dt class="dt dlterm">Description</dt>

                  <dd class="dd">Indicates whether the activity has been moved to the Recycle Bin (<samp class="codeph nolang">true</samp>) or not (<samp class="codeph nolang">false</samp>).
                    Label is <span class="keyword parmname">Deleted</span>.</dd>


                </dl>

              </td>

            </tr>

            <tr>
              <td class="entry" headers="d1331485e67" data-title="Field"><span class="keyword parmname">IsHighPriority</span></td>

              <td class="entry" headers="d1331485e70" data-title="Details">
                <dl class="dl detailList">

                  <dt class="dt dlterm">Type</dt>

                  <dd class="dd">boolean</dd>



                  <dt class="dt dlterm">Properties</dt>

                  <dd class="dd">Defaulted on create, Filter, Group, Sort</dd>



                  <dt class="dt dlterm">Description</dt>

                  <dd class="dd">Indicates a high-priority task. The default value of this field is <samp class="codeph nolang">false</samp>. This field is derived from the
                    <span class="keyword parmname">Priority</span> field.
                  </dd>


                </dl>

              </td>

            </tr>

            <tr>
              <td class="entry" headers="d1331485e67" data-title="Field"><span class="keyword parmname" id="isReminderSet"><a name="isReminderSet"><!-- --></a>IsReminderSet</span></td>

              <td class="entry" headers="d1331485e70" data-title="Details">
                <dl class="dl detailList">

                  <dt class="dt dlterm">Type</dt>

                  <dd class="dd">boolean</dd>



                  <dt class="dt dlterm">Properties</dt>

                  <dd class="dd">Defaulted on create, Filter, Group, Sort</dd>



                  <dt class="dt dlterm">Description</dt>

                  <dd class="dd">Indicates whether a reminder is set for an activity (<samp class="codeph nolang">true</samp>) or not (<samp class="codeph nolang">false</samp>). The default value
                    of this field is <samp class="codeph nolang">false</samp>.</dd>


                </dl>

              </td>

            </tr>

            <tr>
              <td class="entry" headers="d1331485e67" data-title="Field"><span class="keyword parmname">IsTask</span></td>

              <td class="entry" headers="d1331485e70" data-title="Details">
                <dl class="dl detailList">

                  <dt class="dt dlterm">Type</dt>

                  <dd class="dd">boolean</dd>



                  <dt class="dt dlterm">Properties</dt>

                  <dd class="dd">Defaulted on create, Filter, Group, Sort</dd>



                  <dt class="dt dlterm">Description</dt>

                  <dd class="dd">If the value of this field is set to <samp class="codeph nolang">true</samp>, then
                    the activity is a task; if the value is set to <samp class="codeph nolang">false</samp>, then the activity is an event. The default value of this field is
                    <samp class="codeph nolang">false</samp>. Label is <span class="keyword parmname">Task</span>.
                  </dd>


                </dl>

              </td>

            </tr>

            <tr>
              <td class="entry" headers="d1331485e67" data-title="Field"><span class="keyword parmname">IsVisibleInSelfService</span></td>

              <td class="entry" headers="d1331485e70" data-title="Details">
                <dl class="dl detailList">

                  <dt class="dt dlterm">Type</dt>

                  <dd class="dd">boolean</dd>



                  <dt class="dt dlterm">Properties</dt>

                  <dd class="dd">Defaulted on create, Filter, Group, Sort</dd>



                  <dt class="dt dlterm">Description</dt>

                  <dd class="dd">If the value of this field is set to <samp class="codeph nolang">true</samp>, then
                    the activity can be viewed in the self-service portal. The default value of this field is
                    <samp class="codeph nolang">false</samp>. Label is <span class="keyword parmname">Visible in
                      Self-Service</span>.
                  </dd>


                </dl>

              </td>

            </tr>

            <tr>
              <td class="entry" headers="d1331485e67" data-title="Field"><span class="keyword parmname">Location</span></td>

              <td class="entry" headers="d1331485e70" data-title="Details">
                <dl class="dl detailList">

                  <dt class="dt dlterm">Type</dt>

                  <dd class="dd">string</dd>



                  <dt class="dt dlterm">Properties</dt>

                  <dd class="dd">Filter, Group, Nillable, Sort</dd>



                  <dt class="dt dlterm">Description</dt>

                  <dd class="dd">If the activity is an event, then this field represents the location of the event. If
                    the activity is a task, then the value is <samp class="codeph nolang">null</samp>.</dd>


                </dl>

              </td>

            </tr>

            <tr>
              <td class="entry" headers="d1331485e67" data-title="Field"><span class="keyword parmname">OwnerId</span></td>

              <td class="entry" headers="d1331485e70" data-title="Details">
                <dl class="dl detailList">

                  <dt class="dt dlterm">Type</dt>

                  <dd class="dd">reference</dd>



                  <dt class="dt dlterm">Properties</dt>

                  <dd class="dd">Filter, Group, Nillable, Sort</dd>



                  <dt class="dt dlterm">Description</dt>

                  <dd class="dd">Indicates the ID of the user or group who owns the activity.</dd>

                  <dd class="dd">This is a polymorphic relationship field.</dd>



                  <dt class="dt dlterm">Relationship Name</dt>

                  <dd class="dd">Owner</dd>



                  <dt class="dt dlterm">Relationship Type</dt>

                  <dd class="dd">Lookup</dd>



                  <dt class="dt dlterm">Refers To</dt>

                  <dd class="dd">Calendar, Group, User</dd>


                </dl>

              </td>

            </tr>

            <tr>
              <td class="entry" headers="d1331485e67" data-title="Field"><span class="keyword parmname">PrimaryAccountId</span></td>

              <td class="entry" headers="d1331485e70" data-title="Details">
                <dl class="dl detailList">

                  <dt class="dt dlterm">Type</dt>

                  <dd class="dd">reference</dd>



                  <dt class="dt dlterm">Properties</dt>

                  <dd class="dd">Filter, Group, Nillable, Sort</dd>



                  <dt class="dt dlterm">Description</dt>

                  <dd class="dd">Contains the <span class="keyword parmname">AccountId</span> value from the activity record. Available
                    in API versions 30.0 and later to organizations that use Shared Activities.</dd>


                </dl>

              </td>

            </tr>

            <tr>
              <td class="entry" headers="d1331485e67" data-title="Field"><span class="keyword parmname">PrimaryWhoId</span></td>

              <td class="entry" headers="d1331485e70" data-title="Details">
                <dl class="dl detailList">

                  <dt class="dt dlterm">Type</dt>

                  <dd class="dd">reference</dd>



                  <dt class="dt dlterm">Properties</dt>

                  <dd class="dd">Filter, Group, Nillable, Sort</dd>



                  <dt class="dt dlterm">Description</dt>

                  <dd class="dd">Contains the <span class="keyword parmname">WhoId</span> value from the activity record. Available in
                    API versions 30.0 and later to organizations that have enabled Shared Activities.</dd>


                </dl>

              </td>

            </tr>

            <tr>
              <td class="entry" headers="d1331485e67" data-title="Field"><span class="keyword parmname">Priority</span></td>

              <td class="entry" headers="d1331485e70" data-title="Details">
                <dl class="dl detailList">

                  <dt class="dt dlterm">Type</dt>

                  <dd class="dd">picklist</dd>



                  <dt class="dt dlterm">Properties</dt>

                  <dd class="dd">Defaulted on create, Filter, Group, Nillable, Sort</dd>



                  <dt class="dt dlterm">Description</dt>

                  <dd class="dd">Indicates the priority of a task, such as high, normal, or low. The default value of
                    this field is <samp class="codeph nolang">Normal</samp>.</dd>


                </dl>

              </td>

            </tr>

            <tr>
              <td class="entry" headers="d1331485e67" data-title="Field"><span class="keyword parmname">ReminderDateTime</span></td>

              <td class="entry" headers="d1331485e70" data-title="Details">
                <dl class="dl detailList">

                  <dt class="dt dlterm">Type</dt>

                  <dd class="dd">dateTime</dd>



                  <dt class="dt dlterm">Properties</dt>

                  <dd class="dd">Filter, Nillable, Sort</dd>



                  <dt class="dt dlterm">Description</dt>

                  <dd class="dd">Represents the time at which a reminder is scheduled to fire if
                    <span class="keyword parmname">IsReminderSet</span> is set to <samp class="codeph nolang">true</samp>.
                    If <span class="keyword parmname">IsReminderSet</span> is set to <samp class="codeph nolang">false</samp>, then either the user has deselected the reminder checkbox in the user
                    interface or the reminder has already fired at the time indicated by the value.
                  </dd>


                </dl>

              </td>

            </tr>

            <tr>
              <td class="entry" headers="d1331485e67" data-title="Field"><span class="keyword parmname" id="i1455152"><a name="i1455152"><!-- --></a>Status</span></td>

              <td class="entry" headers="d1331485e70" data-title="Details">
                <dl class="dl detailList">

                  <dt class="dt dlterm">Type</dt>

                  <dd class="dd">picklist</dd>



                  <dt class="dt dlterm">Properties</dt>

                  <dd class="dd">Defaulted on create, Filter, Group, Nillable, Sort</dd>



                  <dt class="dt dlterm">Description</dt>

                  <dd class="dd">Indicates the current status of a task. The default value of this field is <samp class="codeph nolang">Not Started</samp>. Each predefined status field sets a value for
                    <span class="keyword parmname">IsClosed</span>. To obtain picklist values, query the TaskStatus
                    object.<div class="p">Possible values are:<ul class="ul bulletList">
                        <li class="li">Completed</li>

                        <li class="li">Deferred</li>

                        <li class="li">In Progress</li>

                        <li class="li">Not Started</li>

                        <li class="li">Waiting on someone else</li>

                      </ul>
                    </div>
                  </dd>


                </dl>

              </td>

            </tr>

            <tr>
              <td class="entry" headers="d1331485e67" data-title="Field"><span class="keyword parmname">Subject</span></td>

              <td class="entry" headers="d1331485e70" data-title="Details">
                <dl class="dl detailList">

                  <dt class="dt dlterm">Type</dt>

                  <dd class="dd">combobox</dd>



                  <dt class="dt dlterm">Properties</dt>

                  <dd class="dd">Filter, Nillable, Sort</dd>



                  <dt class="dt dlterm">Description</dt>

                  <dd class="dd">Contains the subject of the task or event.</dd>


                </dl>

              </td>

            </tr>

            <tr>
              <td class="entry" headers="d1331485e67" data-title="Field"><span class="keyword parmname" id="i1455196"><a name="i1455196"><!-- --></a>WhatId</span></td>

              <td class="entry" headers="d1331485e70" data-title="Details">
                <dl class="dl detailList">

                  <dt class="dt dlterm">Type</dt>

                  <dd class="dd">reference</dd>



                  <dt class="dt dlterm">Properties</dt>

                  <dd class="dd">Filter, Group, Nillable, Sort</dd>



                  <dt class="dt dlterm">Description</dt>

                  <dd class="dd">The <span class="keyword parmname">WhatId</span> represents nonhuman objects such as accounts,
                    opportunities, campaigns, cases, or custom objects. <span class="keyword parmname">WhatId</span>s are
                    polymorphic. Polymorphic means a <span class="keyword parmname">WhatId</span> is equivalent to the ID of
                    a related object. The label is <span class="keyword parmname">Related To ID</span>.</dd>

                  <dd class="dd">This is a polymorphic relationship field.</dd>



                  <dt class="dt dlterm">Relationship Name</dt>

                  <dd class="dd">What</dd>



                  <dt class="dt dlterm">Relationship Type</dt>

                  <dd class="dd">Lookup</dd>



                  <dt class="dt dlterm">Refers To</dt>

                  <dd class="dd">Account, Accreditation, AssessmentIndicatorDefinition, AssessmentTask,
                    AssessmentTaskContentDocument, AssessmentTaskDefinition, AssessmentTaskOrder, Asset,
                    AssetRelationship, AssignedResource, Award, BoardCertification, BusinessLicense,
                    BusinessMilestone, BusinessProfile, Campaign, CareBarrier, CareBarrierDeterminant,
                    CareBarrierType, CareDeterminant, CareDeterminantType, CareDiagnosis,
                    CareInterventionType, CareMetricTarget, CareObservation, CareObservationComponent,
                    CarePgmProvHealthcareProvider, CarePreauth, CarePreauthItem, CareProgram,
                    CareProgramCampaign, CareProgramEligibilityRule, CareProgramEnrollee,
                    CareProgramEnrolleeProduct, CareProgramEnrollmentCard, CareProgramGoal,
                    CareProgramProduct, CareProgramProvider, CareProgramTeamMember,
                    CareProviderAdverseAction, CareProviderFacilitySpecialty, CareProviderSearchableField,
                    CareRegisteredDevice, CareRequest, CareRequestDrug, CareRequestExtension,
                    CareRequestItem, CareSpecialty, CareSpecialtyTaxonomy, CareTaxonomy, Case,
                    CommSubscriptionConsent, ContactEncounter, ContactEncounterParticipant, ContactRequest,
                    Contract, CoverageBenefit, CoverageBenefitItem, CreditMemo, DelegatedAccount,
                    DocumentChecklistItem, EnrollmentEligibilityCriteria, HealthcareFacility,
                    HealthcareFacilityNetwork, HealthcarePayerNetwork, HealthcarePractitionerFacility,
                    HealthcareProvider, HealthcareProviderNpi, HealthcareProviderSpecialty,
                    HealthcareProviderTaxonomy, IdentityDocument, Image, IndividualApplication, Invoice,
                    ListEmail, Location, MemberPlan, Opportunity, Order, OtherComponentTask, PartyConsent,
                    PersonLifeEvent, PlanBenefit, PlanBenefitItem, ProcessException, Product2, ProductItem,
                    ProductRequest, ProductRequestLineItem, ProductTransfer, PurchaserPlan, ReceivedDocument,
                    ResourceAbsence, ReturnOrder, ReturnOrderLineItem, ServiceAppointment, ServiceResource,
                    Shift, Shipment, ShipmentItem, Solution, Visit, VisitedParty, VolunteerProject,
                    WorkOrder, WorkOrderLineItem</dd>


                </dl>

              </td>

            </tr>

            <tr>
              <td class="entry" headers="d1331485e67" data-title="Field"><span class="keyword parmname">WhoId</span></td>

              <td class="entry" headers="d1331485e70" data-title="Details">
                <dl class="dl detailList">

                  <dt class="dt dlterm">Type</dt>

                  <dd class="dd">reference</dd>



                  <dt class="dt dlterm">Properties</dt>

                  <dd class="dd">Filter, Group, Nillable, Sort</dd>



                  <dt class="dt dlterm">Description</dt>

                  <dd class="dd">
                    <p class="p">The WhoId represents a human such as a lead or a contact. WhoIds are polymorphic.
                      Polymorphic means a WhoId is equivalent to a contact’s ID or a lead’s ID. The label is
                      <span class="keyword parmname">Name ID</span>.
                    </p>

                    <p class="p">If Shared Activities is enabled, the value of this field is the ID of the related
                      lead or primary contact. If you add, update, or remove the WhoId field, you might
                      encounter problems with triggers, workflows, and data validation rules that are
                      associated with the record. The label is <span class="keyword parmname">Name ID</span>.</p>

                  </dd>

                  <dd class="dd">This is a polymorphic relationship field.</dd>



                  <dt class="dt dlterm">Relationship Name</dt>

                  <dd class="dd">Who</dd>



                  <dt class="dt dlterm">Relationship Type</dt>

                  <dd class="dd">Lookup</dd>



                  <dt class="dt dlterm">Refers To</dt>

                  <dd class="dd">Contact, Lead</dd>


                </dl>

              </td>

            </tr>

          </tbody>

        </table>

## Usage

Query activities that are related to an object

1. Optionally, issue a describe call against the object whose activities you want to query, to get a suggestion of the correct SOQL query 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 OpenActivities) 
    FROM Account 
    WHERE Name Like 'XYZ%'

The user interface enforces sharing rules, filtering out related-list items that a user doesn’t have permission to see.

The following constraints on users who don’t have the “View All Data” permission help prevent performance issues.

- In the main clause of the relationship query, you can reference only one record. For example, you can’t filter on all records where the account name starts with “A.” Instead, you must reference a single account record.
    
    SELECT 
       (SELECT ActivityDate, Description 
        FROM OpenActivities 
        ORDER BY ActivityDate ASC NULLS LAST, LastModifiedDate DESC 
        LIMIT 500)
    FROM Account
    WHERE Name = 'Acme'
    LIMIT 1
- In the inner clause of the query, you can’t use WHERE.
- In the inner clause of the query, you must specify a limit of 500 or fewer on the number of rows that are returned in the list.
- In the inner clause of the query, you must sort on ActivityDate in ascending order and LastModifiedDate in descending order. You can optionally display nulls last. For example: ORDER BY ActivityDate ASC NULLS LAST, LastModifiedDate DESC.

#### See Also

- [Task](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_task.htm "Represents a business activity such as making a phone call or other to-do items. In the user interface, Task and Event records are collectively referred to as activities.")