Solved

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

Posted on 2011-03-14
4
579 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
  • 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

Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

Join & Write a Comment

There is one common problem that all we SharePoint developers share: custom solution deployment. This topic can't be covered fully in this short article, so all I want to do in this one is to review it from a development-to-operations perspectiv…
Pimping Sharepoint 2007 without Server-Side Code Part 1 One of my biggest frustrations with Sharepoint 2007 in the corporate world is that while good-intentioned managers lock down the more interesting capabilities of Sharepoint programming in…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

708 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now