Get the last modified document on a site collection
-
Hello all. I have a SharePoint 2010 site collection, which has several sites (each in turn containing several sub-sites). I have a requirement to create a WebPart that displays an URL to the last modified document on the entire site collection. My initial approach is to create a timer (SPJobDefinition) that iterates through the entire site collection, open each list, extracting the last modified document and compare it with the next list, and so on. Then, once I have the URL, store such URL somewhere (a property bag or a record on a list). However, this seems too much work for this task. I was wondering if there is an easier way to accomplish this, or if someone has done so before, to give me hints on a better approach. Thanks in advance. Any suggestion will be really appreciated. Best regards.
-
Hello all. I have a SharePoint 2010 site collection, which has several sites (each in turn containing several sub-sites). I have a requirement to create a WebPart that displays an URL to the last modified document on the entire site collection. My initial approach is to create a timer (SPJobDefinition) that iterates through the entire site collection, open each list, extracting the last modified document and compare it with the next list, and so on. Then, once I have the URL, store such URL somewhere (a property bag or a record on a list). However, this seems too much work for this task. I was wondering if there is an easier way to accomplish this, or if someone has done so before, to give me hints on a better approach. Thanks in advance. Any suggestion will be really appreciated. Best regards.
Hello I'm new with Sharepoint, so I may be wrong. I would define a Workflow setting a value every time a document will be changes. This value could be stored for example in a server-file. So your WebPart hasn't to go through all lists and documents - it wil read the value which identifies the newest document. Hope this will help :)
------------------------------ Author of Primary ROleplaying SysTem How do I take my coffee? Black as midnight on a moonless night. War doesn't determine who's right. War determines who's left.