Web Part to View Access to Recent Documents

I was prompted to create a Web Part in Sharepoint that lists the last 10 documents that a user has accessed in a site collection.

A client of mine wants users to be able to access documents so that they don't have to dig through the folder structure to find a document, as users go through the same document over and over most of the time.

The problem is that I am not sure if this is possible as I cannot find any property on SPListItem , SPItem or SPFile that can help me with this task. Has anyone done anything like this or knew of any solution that might help me verify that this is possible?

+2


source to share


2 answers


This information is not available for files and objects in SharePoint. They can only report the creation date and the last modified date.



But one option might be to enable the audit trail for the site collection and query. But pay attention to performance as the audit trail can grow, making real-time queries on all data very slow. Your best bet is to create a background job that frequently queries the audit log for new entries and updates the list of recent requests.

+1


source


It is proposed to develop an HTTP module that intercepts each download of a document. Store information in a custom list, with document ID and username. (And maybe more metadata like site collection name, site name, list name, etc.)

Provide a mechanism in a custom list that only saves the last 10 items.



Add a Content Query Web Part to your page that asks for a custom list based on username and shows items i.e. 10 last viewed documents.

+1


source







All Articles