Solved

Q: how to create SharePoint 2007 alert(workflow) on whenever items in document library are opened?

Posted on 2011-03-14
4
618 Views
Last Modified: 2012-05-11
Hi, SP Experts,

Q: How I can create an alert or a workflow on items in document library of MOSS when they are opened?

Thanks,
-Rick
0
Comment
Question by:RHADMIN
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 6

Expert Comment

by:psv1973
ID: 35130389
Have you enabled audit logging? You could query the audit log in a timer job and then whenever someone views an item run the code that you need to run.

0
 
LVL 1

Author Comment

by:RHADMIN
ID: 35130550
Thanks, psv1973, I think querying the audit log can just do such a work! Do you have any sample code on this?  
-Rick
0
 
LVL 6

Accepted Solution

by:
psv1973 earned 500 total points
ID: 35130644
How about somthing like this in the execute method of your event receiver:

SPAuditQuery query = new SPAuditQuery(SPContext.Current.Site);
query.AddEventRestriction(SPAuditEventType.View);
query.RestrictToUser(userid);
query.SetRangeEnd(DateTime.Now.AddMonths(-1));
query.SetRangeStart(DateTime.Now);
SPAuditEntryCollection auditCol = SPContext.Current.Web.Audit.GetEntries(query);

auditCol will now contain all View events

0
 
LVL 1

Author Comment

by:RHADMIN
ID: 35130737
Thank you psv1973, I think I am on the right track on solving this problem from your help.
-Rick
0

Featured Post

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you create your solutions on SharePoint sooner or later you will come upon a request to set  permissions of the item depending on some of the item's meta-data - the author, people assigned as approvers, divisions, categories etc. The most natu…
These days socially coordinated efforts have turned into a critical requirement for enterprises.
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question