When filtering by the owner, the dashboards in the [Activities] section are displayed incorrectly
Symptoms
In some cases, not all activities, in which the current or selected user is the owner, are displayed in the [Activities] section. Similar situation can be observed on the [Dashboards] tab of the section.
Cause
The situation occurs, when the owner does not get into the list of participants automatically after the activity is created (manually or according to the process). In the [Activities] section, filtering is performed by this detail: only records whose [Participants] detail contains a user specified as the section "Owner" in the filter are displayed.
Solution
Correct the custom process or the activity creation logic so that the owner is added to the [Participants] detail once created. After this, add the corresponding missing participants by a script. An example of a script:
INSERT INTO [ActivityParticipant] ([Id], [ActivityId], [ParticipantId], [RoleId]) SELECT NewId(), a.[Id], a.[OwnerId], '53fc4a92-b0ea-e111-96c4-00165d094c12' FROM [Activity] a WHERE NOT EXISTS ( SELECT ap.[Id] FROM [ActivityParticipant] ap WHERE ap.[ActivityId] = a.[Id] AND ap.[ParticipantId] = a.[OwnerId] )