Muokkaa

Jaa


Activity (ActivityPointer) table

The Activity (ActivityPointer) table stores data about activities or tasks a user performs. An activity is any action that can be entered on a calendar and has time dimensions (start time, stop time, due date, and duration).

When you create an activity record in Dataverse, it creates a corresponding activity pointer record. The activity record and its associated activity pointer record have the same value for the ActivityId column.

The ActivityPointer.ActivityTypeCode column defines the type of the activity. The possible values for this column are defined in the activitypointer_activitytypecode global option set.

Inherited statecode and statuscode options

When you write code that sets or modifies activity columns, it's important to keep in mind that the statecode and statuscode columns ofActivityPointer derived types can have a somewhat different purpose from the base ActivityPointer statecode and statuscode column definitions. The following sections describe these differences.

StateCode option differences

In this section, let's review state code option differences between ActivityPointer and derived types.

ActivityPointer.StateCode defines four options:

Label Value
Open 0
Completed 1
Canceled 2
Scheduled 3

StatusCode label differences

The statuscode options provide reasons for the statecode of the record. You can add new statuscode options so that each table has a different set. Some of the options have the same value as the ActivityPointer statuscode, but the labels can be different.

Labels for statuscode options vary based on whether you're retrieving rows as an ActivityPointer or as a specific activity type such as an Appointment, Email, or Task.

For example, if you retrieve an ActivityPointer row that represents an Appointment, the label for statuscode value 1 is Open rather than Free.

Labels are listed in the definition of the default statuscode options for each table:

Control how activities are sorted by date

When you display a list of activity entities in date order, you can only sort on the common date columns defined in the ActivityPointer table. However, sometimes you want different sorting behaviors depending on the type of activity. For example, you might want to sort email activities by the "sent on" date rather than the "modified on" date. Use the sortdate column to control how activities are sorted by date.

By default, the value of the sortdate column is null. Include logic to set a value for the column and then use the sortdate column in the query you define for the view.

You can set the sortdate column value using a workflow or a plugin. For consistent results, you should set this value for every type of activity and any existing activity data in the system.

See also

Activity tables
ActivityPointer table