HoldSettings.AddToHold method
Add a hold to the web pointed to by the URL with the specified case ID, hold ID, query, and QBE query.
Namespace: Microsoft.Office.RecordsManagement.Preservation
Assembly: Microsoft.Office.Policy (in Microsoft.Office.Policy.dll)
Syntax
'Declaration
Public Function AddToHold ( _
caseId As Guid, _
holdId As Guid, _
serverRelativeUrl As String, _
query As String, _
culture As CultureInfo, _
<OutAttribute> ByRef hold As HoldInfo, _
<OutAttribute> ByRef errorMessage As String _
) As HoldStatus
'Usage
Dim instance As HoldSettings
Dim caseId As Guid
Dim holdId As Guid
Dim serverRelativeUrl As String
Dim query As String
Dim culture As CultureInfo
Dim hold As HoldInfo
Dim errorMessage As String
Dim returnValue As HoldStatus
returnValue = instance.AddToHold(caseId, _
holdId, serverRelativeUrl, query, _
culture, hold, errorMessage)
public HoldStatus AddToHold(
Guid caseId,
Guid holdId,
string serverRelativeUrl,
string query,
CultureInfo culture,
out HoldInfo hold,
out string errorMessage
)
Parameters
caseId
Type: System.GuidThe case ID of the hold being added.
holdId
Type: System.GuidThe hold ID of the hold being added.
serverRelativeUrl
Type: System.StringThe URL of the web to add the hold to.
query
Type: System.StringThe query of the hold being added.
culture
Type: System.Globalization.CultureInfoThe culture for this hold.
hold
Type: Microsoft.Office.RecordsManagement.Preservation.HoldInfoThe HoldInfo object created for this hold.
- errorMessage
Type: System.String
Return value
Type: Microsoft.Office.RecordsManagement.Preservation.HoldStatus
Whether the action succeeded or failed, and the HoldInfo object that is created.