SharePoint Development Bookmark and Share   
 index > SharePoint - Workflow > How To Access Information About an Expiration Policy in the Workflow it Triggers
 

How To Access Information About an Expiration Policy in the Workflow it Triggers

Please pardon my lack of SharePoint knowledge. I'm trying to create an information policy that will alert users to delete documents that have been inactive or unused. My information policy will trigger a WSS3 workflow that gives the user an option to keep the file or delete it. I would like to inform the user how long it has been since the file was modified. How do I reference (in code) the retention period specified on the expiration policy? Thanks!
LostInSharePoint  Thursday, November 12, 2009 9:54 PM
You can get the retention data from the xml returned in the following code. You must be a Site Administrator to do this.

using Microsoft.Office.RecordsManagement.InformationPolicy;

  public static string GetPolicyRetentionPeriod()
  {
            using (SPSite sp = new SPSite("http://basesmcdev2/sites/tester1"))
            {
                PolicyCatalog pc = new PolicyCatalog(sp);
                foreach (Policy p in pc.PolicyList)
                {
                    if (p.Name == "expireme")
                    {
                        return p.Items["Microsoft.Office.RecordsManagement.PolicyFeatures.Expiration"].CustomData;
                    }
                }
   
            }

            return string.Empty;
        
  }
<data>
- <formula id="Microsoft.Office.RecordsManagement.PolicyFeatures.Expiration.Formula.BuiltIn">
  <number>2</number> 
  <property>Modified</property> 
  <period>years</period> 
  </formula>
  <action type="action" id="Microsoft.Office.RecordsManagement.PolicyFeatures.Expiration.Action.MoveToRecycleBin" /> 
  </data>

certdev.com
Steve.Curran  Thursday, November 12, 2009 10:55 PM

You can use google to search for other answers

Custom Search

More Threads

• XML in workflow reports
• Listening for List Item Changed (Repeatedly)
• permission of create new item by workflow problem
• Move entry from one list to another via workflow
• How to get values in task form from list to which my workflow is attached to?
• MOSS workflow permission
• Collected data types changing without user intervention
• error while reading data from infopath forms.
• Multiple Approvers based on list column choice
• Generate same tasks