Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. SharePoint
  4. Get the last modified document on a site collection

Get the last modified document on a site collection

Scheduled Pinned Locked Moved SharePoint
sharepoint
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    Fernando A Gomez F
    wrote on last edited by
    #1

    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.

    I 1 Reply Last reply
    0
    • F Fernando A Gomez F

      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.

      I Offline
      I Offline
      Ingo
      wrote on last edited by
      #2

      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.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups