Sharepoint List Retention Policy based on Modified Date

How do I implement a Sharepoint List Retention Policy that deletes list items that haven't been modified in X days?
I've tried to create a retention policy in Sharepoint, but I only get the option to base the policy on:
Created Date
Declared Record
I need the policy to be based on Modified Date, a standard date field that appears against all lists & document libraries. Is there a configuration change I can make to cause Modified Date to appear in the list of available fields on the Retention Policy
dialog window?
Thanks.

Veda, thanks but I'm not really a hardcore C# coder.
We found more elegant solution was to create a List View which returns all records that should be deleted, based on our own custom deletion criteria, and then create an very simple SSIS Package in Visual Studio using the
Sharepoint Connectors for SSIS to delete all Sharepoint List Items returned from that List View. The Sharepoint Destination Connector has a delete operation.
This worked for us and didn't require any coding.

Similar Messages

  • How to List Sales Orders based on Creation Date and Delivery Priority

    Dear all,
    How can we list Sales Orders based on creation date and delivery priority.
    I tried using vl10a transaction code, but there we can see sales order based on delivery date.
    we need to list all sales order based on delivery priority and sales order creation date.
    can any one of you tell me which standard report gives such kind of report. Your suggestions will be highly appreciated.
    Thank you
    Raghu Ram

    Hi Raghu,
    There is no st report available as per your req.
    Using SQVI, you develope one report that is list of sales orders based on your req.
    SQVI is used to convert a Quick View into a query.
    Quick Viewer:
    The Quick Viewer allows you to define reports without having to program yourself. The Quick
    Viewer is especially useful for new users and occasional use.
    Quick Viewer is a tool for generating reports. SAP Query offers the user a whole range of options for defining reports. SAP Query also supports different kinds of reports such as basic lists, statistics, and ranked lists. Quick Viewer, on the other hand, is a tool that allows even relatively inexperienced users to create basic lists.
    Quick View definitions are user-dependent. You can transfer a Quick View into SAP Query in order to make reports, for example, accessible to additional users, or to use the other functions available in SAP Query.
    The following is a comparison of Quick Views and queries:
    Quick Views possess the same functional attributes as queries. However, only basic lists may be defined with Quick Views.
    In contrast to queries, no user group assignment is necessary with Quick Views. Each user has his/her own personal list of Quick Views. Quick Views cannot be exchanged between users. Quick Views may, however, be converted to queries and then be made available to other users in a specific user group.
    Info Sets are not required for Quick View definition. Whenever you define a Quick View, you can specify its data source explicitly. Tables, database views, table joins, logical databases, and even Info Sets, can all serve as data sources for a Quick View. You can only use additional tables and additional fields if you use an Info Set as a data source.
    The Quick Viewer uses various controls. Certain hardware and software requirements must also be fulfilled before you can use the Quick Viewer.
    To define a Quick View, you select certain fields according to your data source that determine the structure of your report. The report can be executed in basis mode with standard layout or may be edited using drag and drop and the other toolbox functions available in WYSIWYG mode.
    Reports created using the Quick Viewer may also be passed to external programs (Excel, for example).
    Call the Quick Viewer using System -> Services -> Quick Viewer (or transaction SQVI).
    Enter the name of the Quick View. Quick View names can contain a maximum of 14 characters.
    Choose Create.
    Enter a title for the Quick View and remarks, if you think they are relevant.
    If you do not want to base your list on a table, use the possible entries pushbutton in the Data source field to select another data source. You can choose logical databases or Info Sets. In addition, you may also create table joins. For further information, see Selecting a Data Source.
    Choose Basis mode if you want to create the list directly with no list design. Choose Layout mode if you want to define the layout of your list yourself.
    SQVI Table Quick viewer – Used to created quick client dependent reports
    Probably the easiest and most flexible way to do this is thru one of the ABAP query transactions.
    Transaction SQVI can do this and it has a very good help function that explains how it works... the drawback is that it is only for one user.
    You can play around with it and see if it meets your needs...
    The query results will come back in an ALV Grid or Excel... you can select what fields are returned, and have a selection screen to enter the search criteria.
    You can get the report by joining the tables VBAK and VBAP.
    If you have any queries, i will forward screen shots to your id.
    Reward points pls.
    Regards,
    Govind.

  • CAML Query to Sort SharePoint list items based on Modified date

    hi ,
    can we sort sharePoint list items based on 'Modified' column, the sorting should be done up to milliseconds level.
    currently i am using CAML query as below
    <OrderBy><FieldRef Name='Modified' Type='DateTime' IncludeTimeValue='TRUE' Ascending='False'/></OrderBy>but its not considering milliseconds while sorting.
    Thanks and Regards,
    venkatesh.

    Veda, thanks but I'm not really a hardcore C# coder.
    We found more elegant solution was to create a List View which returns all records that should be deleted, based on our own custom deletion criteria, and then create an very simple SSIS Package in Visual Studio using the
    Sharepoint Connectors for SSIS to delete all Sharepoint List Items returned from that List View. The Sharepoint Destination Connector has a delete operation.
    This worked for us and didn't require any coding.

  • Archive/Move files based on Modified Date range to another Library Using PowerShell while retaining Metadata

    Hi,
    I am trying to archive files from a SharePoint 2010 document library by moving them to another library that's a dedicated archive/folder/library. The files to be moved are selected based on their modified date column value that should range between any time
    in the past to January 1st 2012. 
    Also, to be able to retain the tags and cloumn values after the move. Open in explorer does not bring along the user added tags.
    I tried to edit this script
    $WebURL = "http://mysite.com/";
    $ListDisplayName = "Crawl Test Library";
    $ArchiveFolderName = "Crawl Test Library Archive";
    function moveItems ()
    trap
    #make sure we dispose of these in the event of an error to avoid memory leaks:
    write-host "Error - disposing of objects...";
    $Web.Dispose();
    $Site.Dispose();
    [Microsoft.SharePoint.SPSite] $Site = New-Object Microsoft.SharePoint.SPSite($WebURL);
    [Microsoft.SharePoint.SPWeb] $Web = $Site.OpenWeb();
    [Microsoft.SharePoint.SPList] $List = $Web.Lists[$ListDisplayName];
    $FolderToMoveTo = $List.RootFolder.Url + "/" + $FolderName;
    $ItemMoveCount=0;
    $Query = New-Object Microsoft.SharePoint.SPQuery;
    $Query.Folder = $list.RootFolder;
    $camlQuery = "<Where><Leq><FieldRef Name='Modified' /><Value Type='DateTime'>2012-01-01T00:00:00Z</Value></Leq></Where>"
    $Query.Query = $camlQuery
    $Query.RowLimit = 2200; #limit query because of large folder
    $List.GetItems($Query) |
    Where {$_.ContentType.Name -ne "Folder"} |
    foreach-object {
    #Line below will simply output to console and demonstrates another .NET call
    [System.String]::format("Moving Item {0} with ID {1}...",$_.Name, $_.ID.ToString());
    $Web.GetFile($_.Url).MoveTo([System.String]::format("{0}/{1}",$FolderToMoveTo,$_.Name));
    write-host "Success...";
    $ItemMoveCount++;
    write-host "==============================================================================";
    write-host "Complete! -> Moved " $ItemMoveCount " Items to directory " $FolderName;
    write-host "==============================================================================";
    #dispose:
    $Web.Dispose();
    $Site.Dispose();
    #garbage collection
    [GC]::Collect()
    to do that but it doesn't seem to work. I am no guru in powershell yet so any help is appreciated.
    Thanks.

    This solution gets the job done. Much thanks to
    Ian Hayse
    NB...The Modified and Created dates are gonna reflect runtime dates now 
    $web = Get-SPWeb "http://sharepointed.com/"
    $list = $web.Lists["Shared Documents"]
    $spQuery = New-Object Microsoft.SharePoint.SPQuery
    $spQuery.ViewAttributes = "Scope='Recursive'";
    $spQuery.RowLimit = 2000
    $caml = '<Where><Lt><FieldRef Name="Created" /><Value IncludeTimeValue="TRUE" Type="DateTime">2014-01-01T04:06:45Z</Value></Lt></Where> '
    $spQuery.Query = $caml
    do
    $listItems = $list.GetItems($spQuery)
    $spQuery.ListItemCollectionPosition = $listItems.ListItemCollectionPosition
    $listTotal = $listItems.Count
    for ($x=$listTotal-1;$x -ge 0; $x--)
    try
    $listItems[$x].CopyTo("http://sharepoint/Docs/Documents/"+ $listItems[$x].name)
    Write-Host("DELETED: " + $listItems[$x].name)
    $listItems[$x].Recycle()
    catch
    Write-Host $_.Exception.ToString()
    while ($spQuery.ListItemCollectionPosition -ne $null)

  • Days between versions based on modified date

    Hi. I'm looking a way to calc the number of days between the dates of a document on Sharepoint. For example, the ID doc = 3 created 01/03/2014, and modified 01/05/2014; then modified again 01/09/2014. The first calc would be: the modified date minus the created
    date (2 days); the others calcs would be based on the modified data minus the previous modified date. Where can I find a topic with this example? Thanks in advance.

    I did something similar with versions and I used JQuery and ajax calls to web services GetVersionCollection. Now this is for a list not a document library, but maybe you can pick something out of it? The service only works for one item at a time - maybe
    you could add this on the properties form PreSaveAction where you could fill in another field before a save. Search for GetVersionCollection for more info.
    <script type="text/javascript" src="/Javascript/JQuery/JQueryMin.js"></script>
    <script type="text/javascript">
    function getversions() {
    var xmlData ="<soap:Envelope xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>";
    xmlData += "<soap:Body><GetVersionCollection xmlns='http://schemas.microsoft.com/sharepoint/soap/'>";
    xmlData += "<strlistID>Merchandising Projects</strlistID><strlistItemID>789</strlistItemID><strFieldName>ProjComments</strFieldName></GetVersionCollection></soap:Body></soap:Envelope>";
    $.ajax({
    url: "/<SITE/SUBSITE>/_vti_bin/lists.asmx",
    type: "POST",
    dataType: "xml",
    data: xmlData,
    complete:SuccessFunc,
    error: ErrorFunc,
    contentType: "text/xml; charset=\"utf-8\""
    function SuccessFunc(result) {
    //xml node with namespace need to be handled differently for jQuery
    var rTable = "<table>";
    alert(result.responseText);
    $(result.responseXML).find("Version").each(function() {
    if($(this).attr("ProjComments") != "<div></div>") {
    var vDate = $(this).attr("Modified");
    rTable += "<tr><td><b>" + $(this).attr("Editor").split("#,#")[1] + " (" + vDate.substr(5,2) + "/" + vDate.substr(8,2) + "/" + vDate.substr(0,4) + ")</b><br />" + $(this).attr("ProjComments") + "</td></tr>";
    rTable += "</table>";
    $('#versionsOfItem').append(rTable);
    function ErrorFunc(result) {
    alert(result.responseText);
    </script>
    <input type="button" name="btnver" id="btnver" value="Test Versions" onclick="javascript:getversions();"></input>
    <div id="versionsOfItem"></div>
    Robin

  • How to create a sharepoint list to add/change/delete the data in SQL server Table based on users inputs

    I have a table in sql with employee_num and I need to create a list and link that list to this table to make changes to table based on values user enter or selects.

    Hi,
    In addition, you could refer to one similar thread for related information:
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/8ee8a7b2-ddfc-4654-b84e-b062aeb527ae/how-to-create-exernal-list-in-sharepoint-which-fetch-data-from-multiple-sql-table?forum=sharepointgeneral
    Regards,
    Rebecca Tu
    TechNet Community Support

  • Unpivot SharePoint list data in SSRS

    I need to unpivot data from a sharepoint list to support a report.
    the data looks like this
    Policy  comissiona comissionb comissionc
    a           1                 2                 3
    b           4                 5                  6
    i want the result
    as
    policy comission    total 
    a comission a        1
    a comissionb           2
    a  comissionc         3
    b  comission a       4
    bcomissionb           5
    b comissionc         6
     Thanks

    Hi Vision2040,
    Based on my research, it’s not supported that making Unpivot data from a sharepoint list currently.In general, we can use PIVOT and UNPIVOT relational operators to change a table-valued expression into another table.
    For the details, please refer to the link:
    http://technet.microsoft.com/en-us/library/ms177410(v=sql.105).aspx
    Regards,
    Heidi Duan
    Heidi Duan
    TechNet Community Support

  • How to auto populate a column/SharePoint list with Current Date?

    I have a SharePoint list and I created a column called ‘CurrDate’. 
    I need this column to;
     Display the current      date,
    Auto populate all rows with the current date in the      SharePoint list
    Dynamically update with the current date
    I first tried creating the column using the default SharePoint interface Date Time but it’s not doing any of the steps listed above:
    I even tried entering =[Today] in the Calculated Value field. 
    Still nothing…
    So, I’m sure you will toss out a code snippet to make this work, which is great. 
    However, I’m a total noob with SPD, where the heck do I insert this snippet?
    Always in need of help.

    Hi ,
    I understand that you want to add a column  to a list to hold current date. Here is a workaround:
    Add a single line of text column to the list. Name the list as Today.
    Add a calculated column to the list. Use the [Today] as the formula. Set the calculated column to be Date and Time type.
    Delete the Today column from the list.
    Thanks,
    Entan Ming
    TechNet Subscriber Support in forum
    If you have any feedback on our support, please [email protected]
    Entan Ming
    TechNet Community Support

  • Performance Point - need to limit permissions to Sharepoint lists

    I set up Performance Point Dashboard Designer. 
    And as per Microsoft's instructions, I set up an Unattended Service Account for the Performance Point Service Application.
    And I gave this account read permissions under the Web Application's "User Policy".
    However, this gives a user access to see all sharepoint lists when they're creating a data source.
    When a user is creating a data source in Dashboard Designer, I want to limit their permissions to SharePoint lists to only what they normally have access to on the SharePoint sites.
    How can I configure Performance Point service application another way , instead of using an unattended service account?
    Please help!
    thanks!
    Also want to mention that I have Business Intelligence Centre set up as a Site Collection, and I only gave this user "Contribute" permissions, but it still gives them access to see everything in SharePoint sites when they create a data source,
    which shouldn't be!!
    How can I get it to reflect the same permissions that the user has in SharePoint?  They shouldn't see Lists that they don't have access to.

    Does anyone know how to limit permissions for Dashboard Designer??
    any help would be greatly appreciated!!!

  • Retain Modified Date after adding a column

    I have a sharepoint list that has been in use for some time.  
    There are reports generated bases on "last modified"  
    As the site admin, I need to add a column to the list and then enter some values into the new columns. 
    But this changes all of the modified dates.  
    Any was to preserve this date? 

    If you are able to update the list items using PowerShell, you can use the SPListItem.SystemUpdate(false) method.
    This will update the list item without changing the modified date / modified by information, and without creating a new version.
    See: https://msdn.microsoft.com/en-us/library/office/Microsoft.SharePoint.SPListItem.SystemUpdate.aspx
    Regards, Matthew
    MCPD | MCITP
    My Blog
    View
    Matthew Yarlett's profile
    See my webpart on the TechNet Gallery that allows administrative users to upload, crop and format user profile photos. Check it out here:
    Upload and Crop User Profile Photos

  • How To Hide Retention Policy Tag View From OWA.

    Aslam

    Hi,
    I have exactly the opposite problem. In OWA 2013 (SP1) the assigned retention policy and the expiration date is not shown. We are in coexistance with Exchange 2010. OWA 2010, Outlook 2010/2013 are showing the assigned retention policy and the expiration
    date as shown in the first messsage of this thread. Setting "MustDisplayCommentEnabled" to true does not help. Any ideas how the information can be activated?
    Best,
    Manfred

  • Search results showing incorrect modified date

    Hi All,
    I have a one difficulty in search results.
    Document showing incorrect modified date in search results. And this happens for one document only.
    We have customized the search/results.aspx page, Our document is showing correct modified date in document properties,All Items.aspx like 31/4/2013.
    But when i search with document name in search, result showing incorrect modified date like 24/6/2004.
    I checked with database in SQL, every thing is fine.
    I have updated the Modified date through powershell script for one document and after that this recent modified date is showing in search results.
    But after updating the Modified date through powershell, issued document not showing the recent modified date in search results. still showing as 24/6/2004.
    I should not do edit property and save, to create new version.
    I don't know what is happening in search crawl. All ready full crawl running daily basis.
    I want to check whether this issued document is crawling or not. Could anybody help me to get out of this. what is the main cause of this issue.
    Thanks & Regards
    MD.Liakath ali

    Hi,
    I'm seeing the same issue after upgrading the SharePoint 2010 to SharePoint 2013.
    When I search any upgraded document in SharePoint 2013, the document's "Last Modified Date" was showing an incorrect value in Search Results page but other metadata of document like "Last Modified User" is showing the correct
    value so the problem is not with document crawl, something wrong with Last Modified Date property in Search results.
    I have seen below comment as answer but I didn't understand the solution to fix this issue for all upgraded documents.
    The most likely cause is that there is metadata on the documents that is set to that date which is overriding the other dates in the search result. SharePoint isn't particulary imaginative so it's got to be finding that date from somewhere.
    Do we have any solution for this issue? Is this issue will be addressed in SharePoint 2013 SP1?
    Note: No issues with documents, which uploaded after upgrade.

  • Derived Column : for Lookup type column with 'Allow Multiple Selection' : True in sharepoint list

    Hello,
    I have one column where field type is Lookup but 'Allow Multiple Selection' is true in SharePoint List.
    So, in this scenario data from the SharePoint list is being exported as below.
    1;#Red;#3;#Blue;#4;#Black;#5;#Green
    Now resultant text exported to SQL Table should be :
    1,3,4,5
    OR
    Red,Blue,Black,Green
    Either way it is fine. How can we get this using Derived Column and Data Conversion?
    I am able to do this for single occurrence using below expression.
    (DT_STR,100,1252)(SUBSTRING([BusinessUnit],FINDSTRING([BusinessUnit],"#",1)+1,LEN([BusinessUnit])-FINDSTRING([BusinessUnit],"#",1)))
    Please suggest.
    Thank you,
    Mittal.

    Your best bet would be to do this in sql using a string parsing udf as below
    http://visakhm.blogspot.com/2010/02/parsing-delimited-string.html
    You can make it into procedure and call it from oledb command task.
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Sharepoint List Calculation

    I would like to set an End Date in my sharepoint list to automatically match the start date.
    If i choose 5/28 as the start date, the End Date should be 5/28
    How can i do that via a calculated value?

    1.) Set your End Date column to be a calculated field
    2.) In the Formula field that comes up when you set End Date to a calculated field, type =[Start Date] (assuming Start Date is the name of your start date field)

  • Changing the Modified Date of a List Item using the SharePoint Client Object Model (C#) with Contribute Permission

    I have a small snippet of code that I use to update the Modified Date of a list item and it works great for users with Full Control permissions.  However, for users with just Contribute access to the site the code doesn't work.  Instead, SharePoint
    just updates the Modified Date to now.
    I did some testing, and narrowed down the specific permission level that allows updating of Modified dates and oddly enough, it's the "Manage Permissions" level.
    Has anyone run into this issue? If so, how do I work around this and update the Modified date as a user with only Contribute access to a site/library?
    Here's the code:
    DateTime Test = new DateTime(2012, 5, 4);
    ListItem li = list.GetItemById(itemID);
    li["Modified"] = Test;
    li.Update();
    ct.ExecuteQuery();
    Thanks,
    Max

    Hello,
    As a workaround you can pass admin credential in your code because as per my knowledge contributor can't update default columns like: created by, modified by, modified, created.
    ClientContext clientContext = newClientContext(siteUrl);
    ClientContext.Credentials = newNetworkCredential(UserName, Password, Domain);
    Hope it could help
    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help

Maybe you are looking for

  • HT4314 how do you get in-app or app support from apple itunes store?

    I made an in-app purchase of totem in Robinson's Island,  but the totems never registered, but apple chanrged me right away....

  • Oracle weblogic 12c problem

    Hello, After you install the 32bit version of Oracle WebLogic 12c , jdevstudio11115install (Windows 7 32 bit platform) . These actions come after the installation of the domain ADF 's and then completed the installation. I receive the following error

  • Mtmfs: MTM fs Mount server failed...

    After upgrading to Lion, my console is seeing an explosion of errors every second I have Time Machine turned on: 7/22/11 9:39:12.445 PM mtmfs: MTM fs Mount server failed to start because of error -1 7/22/11 9:39:13.946 PM mtmfs: MTM fs Mount server r

  • Unknown error (1417) and (1428)

    Hi, I have updated Itunes to version 7 and I'm trying to do the same for my ipod (version 1.2) but everytime I try, it give me a error window. When I try to update - The unknown error is (1417) and I also tried to restore instead and still gave me an

  • Looking for a Director programmer

    I'm currently looking for a Director programmer to update an existing .dir file for an interactive multimedia display that plays mov, swf, wmv and mpg files. Please send inquiries to: Mark Laber Camp Creative [email protected] www.campcreative.net