Expiration.GetRetentionPolicyForItem Method
Gets the custom data retention XML.
Namespace: Microsoft.Office.RecordsManagement.PolicyFeatures
Assembly: Microsoft.Office.Policy (in Microsoft.Office.Policy.dll)
Syntax
'Declaration
Public Shared Function GetRetentionPolicyForItem ( _
site As SPSite, _
listItem As SPListItem, _
useCachedSettings As Boolean, _
<OutAttribute> ByRef retnSrc As RetentionScheduleSource, _
<OutAttribute> ByRef retentionSourceId As String _
) As String
'Usage
Dim site As SPSite
Dim listItem As SPListItem
Dim useCachedSettings As Boolean
Dim retnSrc As RetentionScheduleSource
Dim retentionSourceId As String
Dim returnValue As String
returnValue = Expiration.GetRetentionPolicyForItem(site, _
listItem, useCachedSettings, retnSrc, _
retentionSourceId)
public static string GetRetentionPolicyForItem(
SPSite site,
SPListItem listItem,
bool useCachedSettings,
out RetentionScheduleSource retnSrc,
out string retentionSourceId
)
Parameters
site
Type: Microsoft.SharePoint.SPSiteIf iterating items, pass the site.
listItem
Type: Microsoft.SharePoint.SPListItemThe item.
useCachedSettings
Type: System.BooleanDetermines whether the policy returned is whatever the items are currently following, or whether the latest changes to settings are to be considered. The event handler should use cached settings until the update policy job runs.
retnSrc
Type: Microsoft.Office.RecordsManagement.PolicyFeatures.RetentionScheduleSourceDetermines whether the policy is available and whether it is defined at the location level or at the content type level.This parameter also determines whether the retention resources are available for the item.
retentionSourceId
Type: System.StringThe URL of the parent folder which contains the policy for this item when location-based policy is used,or the ID of the content type which contains the policy when content type based policy is used.
Return Value
Type: System.String
The custom data retention XML.