• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 657
  • Last Modified:

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

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
RHADMIN
Asked:
RHADMIN
  • 2
  • 2
1 Solution
 
psv1973Commented:
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
 
RHADMINAuthor Commented:
Thanks, psv1973, I think querying the audit log can just do such a work! Do you have any sample code on this?  
-Rick
0
 
psv1973Commented:
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
 
RHADMINAuthor Commented:
Thank you psv1973, I think I am on the right track on solving this problem from your help.
-Rick
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now