SearchAndProcessItem.Add method

Adds the search and process job to the Microsoft Office SharePoint Server 2007 master timer job.

Namespace:  Microsoft.Office.RecordsManagement.SearchAndProcess
Assembly:  Microsoft.Office.Policy (in Microsoft.Office.Policy.dll)

[PermissionSetAttribute(SecurityAction.LinkDemand, Name = "FullTrust")]
[PermissionSetAttribute(SecurityAction.InheritanceDemand, Name = "FullTrust")]
public Guid Add(
	SPWeb web,
	DateTime schedule,
	Guid gParentId,
	int nItemId,
	bool fRememberWebId,
	Guid gItemUniqueId,
	Guid gBatchId,
	int nUserId
)

Parameters

web
Type: Microsoft.SharePoint.SPWeb

The site on which the search and process operation is to be run.

schedule
Type: System.DateTime

The date and time when you want the search and process operation to run.

gParentId
Type: System.Guid

A GUID that identifies the parent of the work item.

nItemId
Type: System.Int32

A 32-bit integer that identifies a list item associated with the work item.

fRememberWebId
Type: System.Boolean

true to set the web identifier; otherwise, false.

gItemUniqueId
Type: System.Guid
gBatchId
Type: System.Guid

A GUID that specifies a context identifier to the job work item engine. The value can vary depending on the job type; for example, for alerts it may store a user ID but for workflow it would store a workflow ID.

nUserId
Type: System.Int32

The user on whose behalf the search and process operation is being performed.

Return value

Type: System.Guid
A GUID that represents the GUID of the timer job created for this request.

The Add method throws an exception if any of the following occurs:

  • The referenced assembly cannot be found, or does not implement the IProcess interface.

  • The time you have specified for the job to run is invalid. For example, you have specified a time in the past.

The search and process operation is created as a one-time, asynchronous timer job.

The nUserId parameter enables you to specify the user on whose behalf the search and process operation is being performed. Items to which the user does not have sufficient rights are not included in the return set of the search and process operations.

Show: