Skip to content

Commit 0f29ba2

Browse files
authored
Merge pull request #8186 from MicrosoftDocs/edit-14460
Editing Request #14460
2 parents 48a1258 + a39688d commit 0f29ba2

File tree

2 files changed

+40
-35
lines changed

2 files changed

+40
-35
lines changed

powerapps-docs/developer/data-platform/TOC.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@
282282
href: task-fax-phone-call-letter-activity-entities.md
283283
- name: ActivityParty table
284284
href: activityparty-entity.md
285-
- name: ActivityPointer (activity) table
285+
- name: Activity (ActivityPointer) table
286286
href: activitypointer-activity-entity.md
287287
- name: Recurring Appointments
288288
items:
Lines changed: 39 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,54 @@
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."
4-
ms.date: 03/25/2023
2+
title: Activity (ActivityPointer) table
3+
description: Learn how to work with the Activity (ActivityPointer) table in Microsoft Dataverse.
4+
ms.date: 07/03/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 write code that sets or modifies activity columns, it's important to keep in mind that the `statecode` and `statuscode` columns of`ActivityPointer` derived types can have a somewhat different purpose from the base `ActivityPointer` `statecode` and `statuscode` column definitions. The following sections describe these differences.
2426

2527
### StateCode option differences
2628

29+
In this section, let's review state code option differences between `ActivityPointer` and derived types.
30+
2731
[ActivityPointer.StateCode](/power-apps/developer/data-platform/reference/entities/activitypointer#statecode-choicesoptions) defines four options:
2832

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

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**.
40+
- [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.
41+
- [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**.
3842

3943
### StatusCode label differences
4044

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.
45+
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.
4246

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).
47+
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).
4448

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**.
49+
For example, if you retrieve an `ActivityPointer` row that represents an `Appointment`, the label for `statuscode` value `1` is **Open** rather than **Free**.
4650

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

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

6064
<a name="bkmk_sortdate"></a>
6165

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-
66+
## Control how activities are sorted by date
67+
68+
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.
69+
70+
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.
71+
72+
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.
73+
6874
### See also
6975

70-
[Activity tables](activity-entities.md)<br />
76+
[Activity tables](activity-entities.md)
7177
[ActivityPointer table](reference/entities/activitypointer.md)
7278

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

0 commit comments

Comments
 (0)