DocumentId.EnableAssignment Method (SPSite, String, Boolean, Boolean, Boolean, Boolean)

Enables or disables the assignment of DocumentId objects on the specified SPSite object.

Namespace:  Microsoft.Office.DocumentManagement
Assembly:  Microsoft.Office.DocumentManagement (in Microsoft.Office.DocumentManagement.dll)

Syntax

'Declaration
Public Shared Sub EnableAssignment ( _
    site As SPSite, _
    prefix As String, _
    fEnable As Boolean, _
    fScheduleAssignment As Boolean, _
    fOverwriteExistingIds As Boolean, _
    fDocsetCtUpdateOnly As Boolean _
)
'Usage
Dim site As SPSite
Dim prefix As String
Dim fEnable As Boolean
Dim fScheduleAssignment As Boolean
Dim fOverwriteExistingIds As Boolean
Dim fDocsetCtUpdateOnly As BooleanDocumentId.EnableAssignment(site, prefix, _
    fEnable, fScheduleAssignment, fOverwriteExistingIds, _
    fDocsetCtUpdateOnly)
public static void EnableAssignment(
    SPSite site,
    string prefix,
    bool fEnable,
    bool fScheduleAssignment,
    bool fOverwriteExistingIds,
    bool fDocsetCtUpdateOnly
)

Parameters

  • fScheduleAssignment
    Type: System.Boolean

    true if the assignment timer job can be scheduled; othrewise, false

  • fDocsetCtUpdateOnly
    Type: System.Boolean

    true if the enable assignment operation applies only to Document Set content types; otherwise, false.

Exceptions

Exception Condition
ArgumentException

The SPSite object or the properties of its root SPWeb object are set to a null reference (Nothing in Visual Basic).

InvalidOperationException

The Document ID feature is not activated on the target SPSite object.

Remarks

Always schedules the assignment timer job, never overwrites existing Ids,applies to all content types, and sets no prefix for Ids.

See Also

Reference

DocumentId Class

DocumentId Members

EnableAssignment Overload

Microsoft.Office.DocumentManagement Namespace

IsAssignmentEnabled(SPSite)