Records.LockItem method (SPListItem, String, SPList, SPWeb, SPSite)
Locks down an item.
Namespace: Microsoft.Office.RecordsManagement.RecordsRepository
Assembly: Microsoft.Office.Policy (in Microsoft.Office.Policy.dll)
Syntax
'Declaration
Public Shared Sub LockItem ( _
itemToLock As SPListItem, _
lockName As String, _
parentList As SPList, _
parentWeb As SPWeb, _
parentSite As SPSite _
)
'Usage
Dim itemToLock As SPListItem
Dim lockName As String
Dim parentList As SPList
Dim parentWeb As SPWeb
Dim parentSite As SPSiteRecords.LockItem(itemToLock, lockName, _
parentList, parentWeb, parentSite)
public static void LockItem(
SPListItem itemToLock,
string lockName,
SPList parentList,
SPWeb parentWeb,
SPSite parentSite
)
Parameters
itemToLock
Type: Microsoft.SharePoint.SPListItemthe item
lockName
Type: System.Stringthe name of the lock
parentList
Type: Microsoft.SharePoint.SPListthe parent list
parentWeb
Type: Microsoft.SharePoint.SPWebthe parent web
parentSite
Type: Microsoft.SharePoint.SPSitethe parent site
Remarks
Designates the SPListItem object as read-only, and checks out an associated SPFile object to the SHAREPOINT\SYSTEM account if such a file exists.
See also
Reference
Microsoft.Office.RecordsManagement.RecordsRepository namespace