Skip to content

Commit bca2b34

Browse files
author
Rhana Cassidy
committed
Editing complete
1 parent a3eba99 commit bca2b34

File tree

1 file changed

+37
-34
lines changed

1 file changed

+37
-34
lines changed
Lines changed: 37 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,52 @@
11
---
2-
title: "ActivityPointer (activity) table (Microsoft Dataverse) | Microsoft Docs" # Intent and product brand in a unique string of 43-59 chars including spaces
3-
description: "The activity pointer (activity) table represents any activity or task a user performs. An activity is any action where you would make an entry on a calendar."
2+
title: Activity (ActivityPointer) table
3+
description: Learn how to work with the Activity (ActivityPointer) table in Microsoft Dataverse.
44
ms.date: 03/25/2023
55
ms.reviewer: pehecke
6-
ms.topic: article
6+
ms.topic: conceptual
77
author: DanaMartens
8-
ms.subservice: dataverse-developer
98
ms.author: dmartens
9+
ms.subservice: dataverse-developer
1010
search.audienceType:
11-
- developer
11+
- developer
12+
ms.custom: bap-template
1213
---
13-
# ActivityPointer (activity) table
1414

15-
The [Activity (ActivityPointer) table](reference/entities/activitypointer.md) represents any activity or task a user performs. An activity is any action where you would make an entry on a calendar.
16-
17-
Whenever you create an activity record in Dataverse, a corresponding activity pointer record is created. The activity record and the corresponding activity pointer record have the same value for the `ActivityId` column. For example, when you create an `Email` record, the column values of `Email.ActivityId` and the corresponding `ActivityPointer.ActivityId` are the same.
18-
19-
The [ActivityPointer.ActivityTypeCode](/power-apps/developer/data-platform/reference/entities/activitypointer#BKMK_ActivityTypeCode) column defines the type of the activity. The possible values for this column are defined in `activitypointer_activitytypecode` global option set.
15+
# Activity (ActivityPointer) table
16+
17+
The [Activity (ActivityPointer) table](reference/entities/activitypointer.md) 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).
18+
19+
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.
20+
21+
The [`ActivityPointer.ActivityTypeCode`](/power-apps/developer/data-platform/reference/entities/activitypointer#BKMK_ActivityTypeCode) column defines the type of the activity. The possible values for this column are defined in the `activitypointer_activitytypecode` global option set.
2022

2123
## Inherited statecode and statuscode options
2224

23-
When you interact with activities with code, it's important to keep in mind that the `statecode` and `statuscode` columns of the types that are derived from `ActivityPointer` can have differences from the `ActivityPointer` `statecode` and `statuscode` column definitions.
25+
When you interact with activities with code, it's important to keep in mind that the `statecode` and `statuscode` columns of the types that are derived from `ActivityPointer` can have differences from the `ActivityPointer` `statecode` and `statuscode` column definitions.<!-- EDITOR'S NOTE: This sentence doesn't make sense to me. I can't figure out a way to rewrite it so that it does make sense. Can you please explain what you mean as if you were talking to a knowledgeable friend? -->
2426

2527
### StateCode option differences
2628

27-
[ActivityPointer.StateCode](/power-apps/developer/data-platform/reference/entities/activitypointer#statecode-choicesoptions) defines four options:
29+
[ActivityPointer.StateCode](/power-apps/developer/data-platform/reference/entities/activitypointer#statecode-choicesoptions) defines four options:<!-- EDITOR'S NOTE: This table and section need an introductory sentence. -->
2830

29-
|Label|Value|
30-
|---------|---------|
31-
|**Open**|0|
32-
|**Completed**|1|
33-
|**Canceled**|2|
34-
|**Scheduled**|3|
31+
| Label | Value |
32+
| --------- | ---------|
33+
| **Open** | 0 |
34+
| **Completed** | 1 |
35+
| **Canceled** | 2 |
36+
| **Scheduled** | 3 |
3537

36-
- [Appointment](/power-apps/developer/data-platform/reference/entities/appointment#statecode-choicesoptions), [Chat](/power-apps/developer/data-platform/reference/entities/chat#statecode-choicesoptions), [RecurringAppointmentMaster](/power-apps/developer/data-platform/reference/entities/recurringappointmentmaster#statecode-choicesoptions), and any custom activities have all four `statecode` options.
37-
- [Email](/power-apps/developer/data-platform/reference/entities/email#statecode-choicesoptions), [Fax](/power-apps/developer/data-platform/reference/entities/fax#statecode-choicesoptions), [Letter](/power-apps/developer/data-platform/reference/entities/letter#statecode-choicesoptions), [PhoneCall](/power-apps/developer/data-platform/reference/entities/phonecall#statecode-choicesoptions), [Task](/power-apps/developer/data-platform/reference/entities/task#statecode-choicesoptions), and [SocialActivity](/power-apps/developer/data-platform/reference/entities/socialactivity#statecode-choicesoptions) only have the first three `statecode` options. There's no valid option to set the state of these activity types as **Scheduled**.
38+
- [Appointment](/power-apps/developer/data-platform/reference/entities/appointment#statecode-choicesoptions), [Chat](/power-apps/developer/data-platform/reference/entities/chat#statecode-choicesoptions), [RecurringAppointmentMaster](/power-apps/developer/data-platform/reference/entities/recurringappointmentmaster#statecode-choicesoptions), and custom activities have all four `statecode` options.
39+
- [Email](/power-apps/developer/data-platform/reference/entities/email#statecode-choicesoptions), [Fax](/power-apps/developer/data-platform/reference/entities/fax#statecode-choicesoptions), [Letter](/power-apps/developer/data-platform/reference/entities/letter#statecode-choicesoptions), [PhoneCall](/power-apps/developer/data-platform/reference/entities/phonecall#statecode-choicesoptions), [Task](/power-apps/developer/data-platform/reference/entities/task#statecode-choicesoptions), and [SocialActivity](/power-apps/developer/data-platform/reference/entities/socialactivity#statecode-choicesoptions) have the first three `statecode` options. There's no valid option to set the state of these activity types as **Scheduled**.
3840

3941
### StatusCode label differences
4042

41-
The `statuscode` options provide reasons for the `statecode` of the record. These option sets can be customized by adding new options, so each table can have a different set of options. Some of the options have the same value as the [ActivityPointer](reference/entities/activitypointer.md) `statuscode` option values, but the labels can be different.
43+
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](reference/entities/activitypointer.md) `statuscode`, but the labels can be different.
4244

43-
Labels for `statuscode` options vary based on whether you're retrieving rows as an [ActivityPointer](reference/entities/activitypointer.md) or a specific activity type such as an [Appointment](reference/entities/appointment.md), [Email](reference/entities/email.md), or [Task](reference/entities/task.md).
45+
Labels for `statuscode` options vary based on whether you're retrieving rows as an [ActivityPointer](reference/entities/activitypointer.md) or as a specific activity type such as an [Appointment](reference/entities/appointment.md), [Email](reference/entities/email.md), or [Task](reference/entities/task.md).
4446

45-
For example, if you retrieve an `ActivityPointer` row that represents an `Appointment`, the label for `statuscode` value `1` shows up as **Open** rather than **Free**.
47+
For example, if you retrieve an `ActivityPointer` row that represents an `Appointment`, the label for `statuscode` value `1` is **Open** rather than **Free**.
4648

47-
You can find the labels in the definition of the default `statuscode` options for each table here:
49+
Labels are listed in the definition of the default `statuscode` options for each table:
4850

4951
- [ActivityPointer.StatusCode Options](/power-apps/developer/data-platform/reference/entities/activitypointer#statuscode-choicesoptions)
5052
- [Appointment.StatusCode Options](/power-apps/developer/data-platform/reference/entities/appointment#statuscode-choicesoptions)
@@ -59,16 +61,17 @@ You can find the labels in the definition of the default `statuscode` options fo
5961

6062
<a name="bkmk_sortdate"></a>
6163

62-
## Control how activities are sorted by date
63-
64-
Whenever you display a list of activity entities and order them by date, you can only use the common date columns defined in the [ActivityPointer](reference/entities/activitypointer.md) table. However, sometimes you want different sorting behaviors depending on the type of activity. For example, with the email table you might want to sort by the `senton` column value rather than the `modifiedon` column value.
65-
66-
Use the `sortdate` column to control how activities are sorted by date. By default, the `sortdate` column value is null. You must include business logic to populate the date value that set for this column and then use the `sortdate` column within the query defined 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.
67-
64+
## Control how activities are sorted by date
65+
66+
When you display a list of activity entities in date order, you can only sort on the common date columns defined in the [ActivityPointer](reference/entities/activitypointer.md) 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.
67+
68+
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.
69+
70+
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.
71+
6872
### See also
6973

70-
[Activity tables](activity-entities.md)<br />
74+
[Activity tables](activity-entities.md)
7175
[ActivityPointer table](reference/entities/activitypointer.md)
7276

73-
74-
[!INCLUDE[footer-include](../../includes/footer-banner.md)]
77+
[!INCLUDE [footer-include](../../includes/footer-banner.md)]

0 commit comments

Comments
 (0)