Export (0) Print
Expand All

SPListItem.Recycle Method

Deletes the item from the content database and returns a globally unique identifier (GUID) for the transaction.

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online

[ClientCallableMethodAttribute(RemoveThisObjectFromParentCollection = true)]
[ClientCallableExceptionConstraintAttribute(FixedId = "4", Condition = "User does not have permissions to update this list item.", 
	ErrorType = typeof(UnauthorizedAccessException))]
[ClientCallableExceptionConstraintAttribute(FixedId = "1", ErrorCode = , Condition = "Expanded recurrence items cannot be updated.", 
	ErrorType = typeof(SPException))]
[ClientCallableExceptionConstraintAttribute(FixedId = "3", Condition = "Method 'Recycle' is not supported on Microsoft.SharePoint.SPListItem for external lists.", 
	ErrorType = typeof(NotSupportedException))]
[ClientCallableExceptionConstraintAttribute(FixedId = "2", ErrorCode = , Condition = "Item does not exist.The page you selected contains an item that does not exist.  It may have been deleted by another user.", 
	ErrorType = typeof(SPException))]
public Guid Recycle()

Return Value

Type: System.Guid
An identifier for the deletion transaction.

ExceptionCondition
NotSupportedException

The parent list has an external data source.

Show:
© 2014 Microsoft