DocumentId.EnableAssignment Method (SPSite, Boolean)
Enables or disables the ability to assign DocumentId to a SPSite object.
Namespace: Microsoft.Office.DocumentManagement
Assembly: Microsoft.Office.DocumentManagement (in Microsoft.Office.DocumentManagement.dll)
Syntax
'Declaration
Public Shared Sub EnableAssignment ( _
site As SPSite, _
fEnable As Boolean _
)
'Usage
Dim site As SPSite
Dim fEnable As BooleanDocumentId.EnableAssignment(site, fEnable)
public static void EnableAssignment(
SPSite site,
bool fEnable
)
Parameters
site
Type: Microsoft.SharePoint.SPSitetrue if it enables DocumentId assignment; otherwise, false
fEnable
Type: System.BooleanSPSite object on which to enable or disable the assignment of a DocumentId object
Exceptions
Exception | Condition |
---|---|
ArgumentException | SPSite object or its root SPWeb object properties are set to a null reference (Nothing in Visual Basic). |
InvalidOperationException | The Document ID feature is not activated for the target SPSite object. |
Remarks
This overload of the EnableAssignment() method always schedules the assignment timer job, never overwrites existing Ids,applies to all content types and sets no prefix for Ids.