Share via


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

  • useCachedSettings
    Type: System.Boolean

    Determines 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.

  • retentionSourceId
    Type: System.String

    The 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.

See also

Reference

Expiration class

Expiration members

Microsoft.Office.RecordsManagement.PolicyFeatures namespace