Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I need a functionality in which something happens after the properties of a document in document library get updated. I need some kind of event to fire after the user clicks Save button in edit form. Could someone briefly explain what do I need to use to make this logic or share some links that could help me understand where to start? I am looking for some code samples. If I am looking for an event, I know how to implement an event handler method body, I just need help with writing or getting that event or event handler itself. Thanks.

share|improve this question
    
What do you need to do? It's possible that a workflow would work too, can you explain more what you need to accomplish after the item is saved with updated metadata? –  PirateEric May 23 '12 at 12:21
    
Sure, when the user edits the properties of the document those values should also be entered for some other list items in some other lists on SharePoint site. It's like updating two lists from the same location. –  Boris May 23 '12 at 14:30

2 Answers 2

up vote 1 down vote accepted

I would suggest reviewing Karine Bosch's blog posts series on SharePoint Event Receivers that includes simple Walkthroughs with Document Library Event Receivers.

share|improve this answer
    
Great, I'll take a look! If it helps me understand how to implement my code, I'll mark your answer as correct. Thanks! –  Boris May 23 '12 at 14:31
    
Brilliant! Thanks so much, Karine Bosch for president! –  Boris May 24 '12 at 13:18
    
She's also the developer of CAML Designer - a very versatile SharePoint development tool - karinebosch.wordpress.com/2012/05/12/caml-designer –  Supriyo SB Chatterjee May 24 '12 at 14:04

You could do this with a workflow as long as there is a logical link between the document and the list(s) like a lookup column from the list(s) to the document library item. When the document library item is edited, it looks up those lists and edits the corresponding values to keep the data in sync.

share|improve this answer
    
I am not completely sure the workflow would work here because the only relation I have between the document whose properties are being updated on one side, and the document whose properties should be updated on the other side is the file name. So, I think that the event receivers or something like that might be more suitable. I could be wrong of course, what do you think? –  Boris May 23 '12 at 15:09
    
It's probably the way to go in your case, I wanted to toss it out there as an alternative. The success of the workflow route depends a lot on how the lists and libraries are designed, if you don't create lookup columns to ensure relationships between the files, it can be difficult to keep things in sync with workflows. –  PirateEric May 23 '12 at 15:22

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.