Solved

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

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

Office 365 Training for IT Pros

Learn how to provision Office 365 tenants, synchronize your on-premise Active Directory, and implement Single Sign-On.

Question has a verified solution.

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

When installing SharePoint 2010 RTM I came across a strange error, I was getting timeouts during the installation. I searched the web and found the best solution to be found here (http://social.msdn.microsoft.com/Forums/en-US/sharepoint2010genera…
The vision: A MegaMenu for a SharePoint portal home page The mission: Make it easy to maintain. Allow rich content and sub headers as well as standard links. Factor in frequent changes without involving developers or a lengthy Dev/Test/Prod rel…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

739 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