ActivityEvent.CreateActivityEvent Method (Microsoft.Office.Server.ActivityFeed)

Switch View :
ScriptFree
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)
Syntax

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.
Remarks

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

See Also

Reference

Community Content

crowleyj
Create Activity Events -- working around admin restriction

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




Christopher Quick
Other ways to create activity feed entries...
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?