Changing file creation datesHi! I've got a file archive with multiple views, each for a different month of the year (and files are sorted into these views by creation date). However, at the beginning, some files were uploaded at the same time, and have erroneous creation dates. I need to change these creation dates so that the files can be viewed properly. Note: I can't sit in front of the server, I can only administrate through SharePoint Designer, Visual Web Studio express or IE Browser.<br/> <br/>Any advice on how to do that? I couldn't find anything online.<br/><br/>Thanks!<br/><br/>Spaz<br/>© 2009 Microsoft Corporation. All rights reserved.Sat, 10 Oct 2009 02:54:01 Z18ce0e5e-a614-4e59-a084-2f36db5b9830http://social.technet.microsoft.com/Forums/en-US/sharepointdevelopment/thread/18ce0e5e-a614-4e59-a084-2f36db5b9830#18ce0e5e-a614-4e59-a084-2f36db5b9830http://social.technet.microsoft.com/Forums/en-US/sharepointdevelopment/thread/18ce0e5e-a614-4e59-a084-2f36db5b9830#18ce0e5e-a614-4e59-a084-2f36db5b9830spazmospazmohttp://social.technet.microsoft.com/Profile/en-US/?user=spazmospazmoChanging file creation datesHi! I've got a file archive with multiple views, each for a different month of the year (and files are sorted into these views by creation date). However, at the beginning, some files were uploaded at the same time, and have erroneous creation dates. I need to change these creation dates so that the files can be viewed properly. Note: I can't sit in front of the server, I can only administrate through SharePoint Designer, Visual Web Studio express or IE Browser.<br/> <br/>Any advice on how to do that? I couldn't find anything online.<br/><br/>Thanks!<br/><br/>Spaz<br/>Fri, 26 Jun 2009 18:44:23 Z2009-06-26T18:44:23Zhttp://social.technet.microsoft.com/Forums/en-US/sharepointdevelopment/thread/18ce0e5e-a614-4e59-a084-2f36db5b9830#985f9bcc-5caa-426b-a92e-94a1613eea49http://social.technet.microsoft.com/Forums/en-US/sharepointdevelopment/thread/18ce0e5e-a614-4e59-a084-2f36db5b9830#985f9bcc-5caa-426b-a92e-94a1613eea49David Lozzihttp://social.technet.microsoft.com/Profile/en-US/?user=David%20LozziChanging file creation dates<p>SPListItem object... check out<br/><a href="http://www.moss2007.be/blogs/vandest/archive/2009/04/13/sharepoint-2007-update-system-properties-created-created-by-modified-modified-by.aspx">http://www.moss2007.be/blogs/vandest/archive/2009/04/13/sharepoint-2007-update-system-properties-created-created-by-modified-modified-by.aspx</a><br/><br/>HTH</p><hr class="sig">David Lozzi<br/> <a href="http://www.delphi-ts.com?utm_source=MSDN">Delphi Technology Solutions</a><br/> <a href="http://www.delphi-ts.com/blogs/lozzi?utm_source=MSDN">Blog</a>  |  <a href="http://www.linkedin.com/in/davidlozzi">LinkedIn</a> | <a href="http://www.twitter.com/davidlozzi">Twitter</a>Fri, 26 Jun 2009 19:43:52 Z2009-06-26T19:43:52Zhttp://social.technet.microsoft.com/Forums/en-US/sharepointdevelopment/thread/18ce0e5e-a614-4e59-a084-2f36db5b9830#db007dea-1210-43f1-aa8a-7fe2ddae6b54http://social.technet.microsoft.com/Forums/en-US/sharepointdevelopment/thread/18ce0e5e-a614-4e59-a084-2f36db5b9830#db007dea-1210-43f1-aa8a-7fe2ddae6b54Peter Holparhttp://social.technet.microsoft.com/Profile/en-US/?user=Peter%20HolparChanging file creation datesHi Spaz,<br/><br/>&quot;I can only administrate through SharePoint Designer, Visual Web Studio express or IE Browser.&quot;<br/><br/>Then this question may be posted to the incorrect forum, as there is a separate one for administration:<br/>SharePoint - Setup, Upgrade, Administration and Operation<br/><a href="http://social.msdn.microsoft.com/Forums/en-US/sharepointadmin/threads">http://social.msdn.microsoft.com/Forums/en-US/sharepointadmin/threads</a><br/><br/>Can you create code that calls a SOAP web service from Visual Web Studio Express and do you have the knowledge and experience to do that?<br/>If yes, then you can try to update this field using the UpdateListItems() method (see <a href="http://msdn.microsoft.com/en-us/library/lists.lists.updatelistitems.aspx">http://msdn.microsoft.com/en-us/library/lists.lists.updatelistitems.aspx</a>), but I am a little bit sceptic.<br/><br/>Otherwise, it would be the best to get a person with direct access to the server and try the same with the SharePoint object model:<br/>Can we update the values of &quot;Created By&quot;, &quot;Modified By&quot; columns in SharePoint lists ?<br/><a href="http://blogs.msdn.com/sowmyancs/archive/2008/03/14/can-we-update-the-values-of-created-by-modified-by-columns-in-sharepoint-lists.aspx"><span style="color:#0033cc">http://blogs.msdn.com/sowmyancs/archive/2008/03/14/can-we-update-the-values-of-created-by-modified-by-columns-in-sharepoint-lists.aspx</span></a><br/><br/>One thing you could do through standard SharePoint web based user interface is to add a new mandatory text field (let's call it Modified2) to your document library and set the default value of the field to be a calculated value (=[Modified]), and then modify the date in this field for the items it is required, and modify your views to use the Modified2 instead of Modified. The problem is that SharePoint does not behave like SQL server, adding a new required field with a default value does not affect existing items. For these items, the new field will be empty. Bad news. No more idea.<br/><br/>Peter<br/><br/><br/>Fri, 26 Jun 2009 20:36:52 Z2009-06-26T20:36:52Zhttp://social.technet.microsoft.com/Forums/en-US/sharepointdevelopment/thread/18ce0e5e-a614-4e59-a084-2f36db5b9830#3eee7e9d-3199-4bef-969e-055765d1cfe5http://social.technet.microsoft.com/Forums/en-US/sharepointdevelopment/thread/18ce0e5e-a614-4e59-a084-2f36db5b9830#3eee7e9d-3199-4bef-969e-055765d1cfe5Steve.Curranhttp://social.technet.microsoft.com/Profile/en-US/?user=Steve.CurranChanging file creation datesYou are going to have to write some code using the object model and batch update the items you want to change the created date for. The created date is a read only field and it's readonly property must be set to false before updating. Below is some example code:<br/><br/> <pre lang="x-c#"> public static void SetReadOnlyField() { using (SPSite site = new SPSite(&quot;http://basesmcdev2/sites/tester1/&quot;)) { using (SPWeb web = site.OpenWeb()) { try { SPDocumentLibrary spdocLib = (SPDocumentLibrary)web.Lists[&quot;tester2&quot;]; SPFieldDateTime spd = (SPFieldDateTime)spdocLib.Fields[&quot;Created&quot;]; spd.ReadOnlyField = false; spd.Update(); spdocLib.Update(); SPListItem myitem = spdocLib.Items.GetItemById(18); object myval = myitem[&quot;Created&quot;]; myitem[&quot;Created&quot;] = DateTime.Parse(&quot;05/12/09&quot;); myitem.Update(); spdocLib.Update(); spd.ReadOnlyField = true; spd.Update(); spdocLib.Update(); } catch (Exception ex) { string msg = ex.Message; } } } }</pre><hr class="sig"><a href="http://www.certdev.com">certdev.com</a>Fri, 26 Jun 2009 22:51:52 Z2009-06-26T22:51:52Zhttp://social.technet.microsoft.com/Forums/en-US/sharepointdevelopment/thread/18ce0e5e-a614-4e59-a084-2f36db5b9830#22974782-83dc-4c03-9637-059ef890e3b3http://social.technet.microsoft.com/Forums/en-US/sharepointdevelopment/thread/18ce0e5e-a614-4e59-a084-2f36db5b9830#22974782-83dc-4c03-9637-059ef890e3b3Peter Holparhttp://social.technet.microsoft.com/Profile/en-US/?user=Peter%20HolparChanging file creation datesSteve, David,<br/><br/>It's all very nice in theory, but how can he apply that in practice if &quot;I can't sit in front of the server, I can only administrate through SharePoint Designer, Visual Web Studio express or IE Browser.&quot;??<br/><br/>PeterSat, 27 Jun 2009 06:59:06 Z2009-06-27T06:59:06Zhttp://social.technet.microsoft.com/Forums/en-US/sharepointdevelopment/thread/18ce0e5e-a614-4e59-a084-2f36db5b9830#d52cd013-195f-4c1f-b354-0ff88a2bb345http://social.technet.microsoft.com/Forums/en-US/sharepointdevelopment/thread/18ce0e5e-a614-4e59-a084-2f36db5b9830#d52cd013-195f-4c1f-b354-0ff88a2bb345Steve.Curranhttp://social.technet.microsoft.com/Profile/en-US/?user=Steve.CurranChanging file creation datesThe issue here is the creation date not the &quot;modified by&quot; or &quot;created by&quot; fields. The creation date can only be modified by setting its ReadOnly property to false before you edit it. There is no web service which will do this, so you must execute some object model code to set this property. Once the ReadOnly property has been set to false for the creation date column it will show up in the SharePoint UI EditForm.aspx and you will be able to change the date from the &quot;IE Browser&quot;, so its not theory and it satisfies one of the requirements of the question.<br/><br/>Thanks.<hr class="sig"><a href="http://www.certdev.com">certdev.com</a>Sat, 27 Jun 2009 23:19:50 Z2009-06-27T23:19:50Zhttp://social.technet.microsoft.com/Forums/en-US/sharepointdevelopment/thread/18ce0e5e-a614-4e59-a084-2f36db5b9830#fe2d3ebb-d01a-429e-85c0-8ac0ce498bdehttp://social.technet.microsoft.com/Forums/en-US/sharepointdevelopment/thread/18ce0e5e-a614-4e59-a084-2f36db5b9830#fe2d3ebb-d01a-429e-85c0-8ac0ce498bdePeter Holparhttp://social.technet.microsoft.com/Profile/en-US/?user=Peter%20HolparChanging file creation datesSteve,<br/><br/>Sorry, but since he wrote he can't sit in front of computer (I assume no remote desktop connection or administrators' help to run such code on the server, as Spaz has not mentioned that, but it would be useful having a feedback about that from he) I still think it is theory in his case. If he had direct access to the computer, it would be very nice, of course.<br/><br/>I see only a single requirement in the question: changing the creation date of the files given the condition &quot;I can't sit in front of the server, I can only administrate through SharePoint Designer, Visual Web Studio express or IE Browser.&quot; I interpreted this as we can not use methods that rely on the object model, but I may be wrong in that. I'm really curious how would you achieve that without having a login session (either sitting in front of it, or using remote desktop) on the server? Of course, if you had once such access, and installed custom code (like custom web service or user interface), then you would be able to do it later remotely using your components...<br/><br/>&quot;The creation date can only be modified by setting its ReadOnly property to false before you edit it.&quot;<br/>In the article linked by David above, Steven Van de Craen wrote about setting Created, Created By, Modified, Modified By fields without setting ReadOnlyField property. I have not tried that out yet, but assume it works. I will check it soon. Of course, this solution also requires direct access to the server.<br/><br/>Thanks!<br/><br/>PeterSun, 28 Jun 2009 07:39:45 Z2009-06-28T07:39:45Zhttp://social.technet.microsoft.com/Forums/en-US/sharepointdevelopment/thread/18ce0e5e-a614-4e59-a084-2f36db5b9830#10bc42ea-2436-4b72-aac6-6d59f170be0fhttp://social.technet.microsoft.com/Forums/en-US/sharepointdevelopment/thread/18ce0e5e-a614-4e59-a084-2f36db5b9830#10bc42ea-2436-4b72-aac6-6d59f170be0fPeter Holparhttp://social.technet.microsoft.com/Profile/en-US/?user=Peter%20HolparChanging file creation dates<p>Hi,<br/><br/>I am back with the results.<br/><br/>I've tried Steven Van de Craen's code, it works, of course I've changed the user name in his code to match my system. <br/><br/>I've also tried to set fields not to be read only. Based on checking the result, the change was successful (ReadOnlyField was false), but despite that first the fields are not displayed on the edit form of the document library, even after an IISRESET.<br/><br/>I did it using the code below:<br/>SPField field = list.Fields[&quot;Modified&quot;];<br/>field.ReadOnlyField = false;<br/>field.Update();<br/>// update list, just to be sure<br/>list.Update();<br/><br/>Then I've tried setting field properties on the site collection level and pushing changes down (of course this method has the downside effecting all lists of the site collection):<br/>SPField field2 = web.Fields[&quot;Modified&quot;];<br/>field2.ReadOnlyField = false;<br/>field2.Update(true);<br/>// update web, just to be sure<br/>web.Update();<br/><br/>It was successful, but had effect only on document libraries but not for lists. After this I set back the field2.ReadOnlyField = true, but since that I am able to set field.ReadOnlyField = false also with success.<br/><br/>Steve, how did you do that? What made I wrong?<br/><br/>Thanks in advance!<br/><br/>Peter</p>Sun, 28 Jun 2009 13:31:51 Z2009-06-28T13:31:51Zhttp://social.technet.microsoft.com/Forums/en-US/sharepointdevelopment/thread/18ce0e5e-a614-4e59-a084-2f36db5b9830#5cd76e91-2841-4569-86d7-3f34488cffbehttp://social.technet.microsoft.com/Forums/en-US/sharepointdevelopment/thread/18ce0e5e-a614-4e59-a084-2f36db5b9830#5cd76e91-2841-4569-86d7-3f34488cffbeSteve.Curranhttp://social.technet.microsoft.com/Profile/en-US/?user=Steve.CurranChanging file creation datesSharePoint is strange. It appears the created date and the last modified date fields will only show up as editable in the EditForm.aspx for a document library and not a List. It could have something to do with the content type. Not sure but very strange.<hr class="sig"><a href="http://www.certdev.com">certdev.com</a>Sun, 28 Jun 2009 22:17:40 Z2009-06-28T22:17:40Zhttp://social.technet.microsoft.com/Forums/en-US/sharepointdevelopment/thread/18ce0e5e-a614-4e59-a084-2f36db5b9830#e714fa56-c34f-4271-bbc7-04ba6bd3d878http://social.technet.microsoft.com/Forums/en-US/sharepointdevelopment/thread/18ce0e5e-a614-4e59-a084-2f36db5b9830#e714fa56-c34f-4271-bbc7-04ba6bd3d878Peter Holparhttp://social.technet.microsoft.com/Profile/en-US/?user=Peter%20HolparChanging file creation dates&quot;SharePoint is strange.&quot;<br/><br/>Absolutely agree in that. That is what makes it exciting to work with. And yes, sometimes frustrating. :-)<br/><br/>As I wrote first it seemed to me not to work for document library either, but I might have made some mistakes there. Once I would have time I will check it with Reflector. Probably I have to check the ListFieldIterator again, one of my good old friends from the past weeks.<br/><br/>It would be nice to know if this behavior is a bug or by design.<br/><br/>PeterMon, 29 Jun 2009 06:38:55 Z2009-06-29T06:38:55Zhttp://social.technet.microsoft.com/Forums/en-US/sharepointdevelopment/thread/18ce0e5e-a614-4e59-a084-2f36db5b9830#34bd17bb-565b-46c8-98eb-345efd69f8ebhttp://social.technet.microsoft.com/Forums/en-US/sharepointdevelopment/thread/18ce0e5e-a614-4e59-a084-2f36db5b9830#34bd17bb-565b-46c8-98eb-345efd69f8ebpatharshhttp://social.technet.microsoft.com/Profile/en-US/?user=patharshChanging file creation datesHi,<br/> <br/> Create a workflow in SharePoint Designer to change date of your field according to you, <br/> <br/> then run workflow in your site from IE. After changes are done, remove the workflow.<br/> <br/><hr class="sig">Harsh PatelMon, 29 Jun 2009 13:43:08 Z2009-06-29T13:43:08Zhttp://social.technet.microsoft.com/Forums/en-US/sharepointdevelopment/thread/18ce0e5e-a614-4e59-a084-2f36db5b9830#ef810a8f-a99a-41fd-a892-6abe8616c7f4http://social.technet.microsoft.com/Forums/en-US/sharepointdevelopment/thread/18ce0e5e-a614-4e59-a084-2f36db5b9830#ef810a8f-a99a-41fd-a892-6abe8616c7f4Peter Holparhttp://social.technet.microsoft.com/Profile/en-US/?user=Peter%20HolparChanging file creation datesHi Harsh,<br/><br/>Which built-in SPD activity can be used to change the Modified field? Also starting the activity and modifying a batch of items seems to me a bit of challange too (which items to update, where the new values come from, etc.).<br/><br/>PeterMon, 29 Jun 2009 15:58:14 Z2009-06-29T15:58:14Zhttp://social.technet.microsoft.com/Forums/en-US/sharepointdevelopment/thread/18ce0e5e-a614-4e59-a084-2f36db5b9830#ebcbc0f1-d54d-44ba-9522-6feda4a7de8fhttp://social.technet.microsoft.com/Forums/en-US/sharepointdevelopment/thread/18ce0e5e-a614-4e59-a084-2f36db5b9830#ebcbc0f1-d54d-44ba-9522-6feda4a7de8fspazmospazmohttp://social.technet.microsoft.com/Profile/en-US/?user=spazmospazmoChanging file creation datesHi, Peter. Thanks for reiterating my point for me that I have no access to the server/computer. To answer your question I do not have access to Remote Desktop and since the client is the U.S. Federal Government it could take months to apply to receive the forms needed to get access to the request system to get an administrator to put me on his schedule of people to talk to.<br/><br/>So basically, I have SharePoint Designer, Visual Studio Express and Internet Explorer.<br/><br/>I notice you guys are discussing a C# script. Is this something I could put on the sharepoint server and run?<br/><br/>Thanks!<br/><br/>SpazFri, 03 Jul 2009 18:09:29 Z2009-07-03T18:09:29Zhttp://social.technet.microsoft.com/Forums/en-US/sharepointdevelopment/thread/18ce0e5e-a614-4e59-a084-2f36db5b9830#3c1eea2c-0d69-4ce8-ae76-dda4ad41b7dahttp://social.technet.microsoft.com/Forums/en-US/sharepointdevelopment/thread/18ce0e5e-a614-4e59-a084-2f36db5b9830#3c1eea2c-0d69-4ce8-ae76-dda4ad41b7daspazmospazmohttp://social.technet.microsoft.com/Profile/en-US/?user=spazmospazmoChanging file creation datesHey, Harsh! It would be great if that were possible! Can you recommend how this is done?<br/><br/>Thanks!<br/><br/>SpazmoFri, 03 Jul 2009 18:10:02 Z2009-07-03T18:10:02Zhttp://social.technet.microsoft.com/Forums/en-US/sharepointdevelopment/thread/18ce0e5e-a614-4e59-a084-2f36db5b9830#fa58aa4c-addd-4582-89d8-d2d72372f73chttp://social.technet.microsoft.com/Forums/en-US/sharepointdevelopment/thread/18ce0e5e-a614-4e59-a084-2f36db5b9830#fa58aa4c-addd-4582-89d8-d2d72372f73cPeter Holparhttp://social.technet.microsoft.com/Profile/en-US/?user=Peter%20HolparChanging file creation datesHi Spazmo,<br/><br/>C# is one (and maybe the most important) programming language that can one use when developing on the .NET Framework. It is not a script and you can use it both client and server side.<br/><br/>PeterSat, 04 Jul 2009 17:20:04 Z2009-07-04T17:20:04Zhttp://social.technet.microsoft.com/Forums/en-US/sharepointdevelopment/thread/18ce0e5e-a614-4e59-a084-2f36db5b9830#a3caf8e6-caac-4f27-afdb-df4716e9983bhttp://social.technet.microsoft.com/Forums/en-US/sharepointdevelopment/thread/18ce0e5e-a614-4e59-a084-2f36db5b9830#a3caf8e6-caac-4f27-afdb-df4716e9983bspazmospazmohttp://social.technet.microsoft.com/Profile/en-US/?user=spazmospazmoChanging file creation datesGood advice, Peter! Thanks for being vigilant in representing my limited access to the server in this thread.<br/><br/>I'm going to devote some time to C# (I'm coming from the world of Linux and PHP, so this is all new to me).<br/><br/>I decided that creating views based on creation date is too dificult, so I'm adding a month/date field that is mandatory information when files are uploaded.<br/><br/>Should work out great.<br/><br/>Thanks for the help, everyone!<br/><br/>SpazMon, 06 Jul 2009 18:08:29 Z2009-07-06T18:08:29Zhttp://social.technet.microsoft.com/Forums/en-US/sharepointdevelopment/thread/18ce0e5e-a614-4e59-a084-2f36db5b9830#ac742d75-09ba-48f4-994b-3ef167076adahttp://social.technet.microsoft.com/Forums/en-US/sharepointdevelopment/thread/18ce0e5e-a614-4e59-a084-2f36db5b9830#ac742d75-09ba-48f4-994b-3ef167076adaPeter Holparhttp://social.technet.microsoft.com/Profile/en-US/?user=Peter%20HolparChanging file creation datesHi Spaz,<br/><br/>Thanks for the feedback, and let us know if you still need help.<br/><br/>PeterMon, 06 Jul 2009 19:03:43 Z2009-07-06T19:03:43Zhttp://social.technet.microsoft.com/Forums/en-US/sharepointdevelopment/thread/18ce0e5e-a614-4e59-a084-2f36db5b9830#d14b6a40-a56b-4e36-b978-9430304697d7http://social.technet.microsoft.com/Forums/en-US/sharepointdevelopment/thread/18ce0e5e-a614-4e59-a084-2f36db5b9830#d14b6a40-a56b-4e36-b978-9430304697d7Peter Holparhttp://social.technet.microsoft.com/Profile/en-US/?user=Peter%20HolparChanging file creation datesHi Spaz,<br /><br />Maybe not ideal for you, as it requires an initial local access to the server to deploy the solution, but after that one can use the solution to modify list item system properties, like created by or modified date through standard SharePoint web user interface using the custom field I've created.<br /><br />You can read more about it in my blog here:<br />Changing system properties for an item from the SharePoint user interface <br /><a href="http://pholpar.spaces.live.com/blog/cns!2CD45589973F2849!200.entry">http://pholpar.spaces.live.com/blog/cns!2CD45589973F2849!200.entry</a><br /><br />Hope that helps someone.<br /><br />PeterSat, 10 Oct 2009 02:54:01 Z2009-10-10T02:54:01Z