Click to Rate and Give Feedback
Community Content
In this section
Statistics Annotations (2)
Collapse All/Expand All Collapse All
ActivityEvent..::.CreateActivityEvent Method

Static method that creates an ActivityEvent object and associates it with an ActivityType object.

Namespace:  Microsoft.Office.Server.ActivityFeed
Assembly:  Microsoft.Office.Server.UserProfiles (in Microsoft.Office.Server.UserProfiles.dll)
Visual Basic (Declaration)
Public Shared Function CreateActivityEvent ( _
    objManager As ActivityManager, _
    activityTypeId As Long, _
    owner As Entity, _
    publisher As Entity _
) As ActivityEvent
Visual Basic (Usage)
Dim objManager As ActivityManager
Dim activityTypeId As Long
Dim owner As Entity
Dim publisher As Entity
Dim returnValue As ActivityEvent

returnValue = ActivityEvent.CreateActivityEvent(objManager, _
    activityTypeId, owner, publisher)
C#
public static ActivityEvent CreateActivityEvent(
    ActivityManager objManager,
    long activityTypeId,
    Entity owner,
    Entity publisher
)

Parameters

objManager
Type: Microsoft.Office.Server.ActivityFeed..::.ActivityManager
The ActivityManager object that is responsible for gathering this ActivityEvent.
activityTypeId
Type: System..::.Int64
The identifier of the ActivityType with which this ActivityEvent is associated. This type defines the display formatting of the event.
owner
Type: Microsoft.Office.Server.ActivityFeed..::.Entity
The entity that owns this ActivityEvent.
publisher
Type: Microsoft.Office.Server.ActivityFeed..::.Entity
The entity that publishes this ActivityEvent.

Only users with administrative permissions for the User Profile Service Application can use this method.

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Create Activity Events -- working around admin restriction      crowleyj   |   Edit   |   Show History

See this sample for a way to work around the requirement that only UPA admins can create activity events. You can store information about each event in a list and then create the events by using a timer job:


http://archive.msdn.microsoft.com/doclibactivityevent



Tags What's this?: Add a tag
Flag as ContentBug
Other ways to create activity feed entries...      Christopher Quick   |   Edit   |   Show History
Most of the code samples show using this method to create activity feed events, but with the restriction of having to be an administrator, this seems to limit the ability to use this in any code executed by an end user -- for example, the send link to colleague sample. Why would this be a demonstrated way of creating an activity feed event if this method can only be executed by user profile service application administrators?
Tags What's this?: Add a tag
Flag as ContentBug
Processing
© 2012 Microsoft. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker