Solved

Problem with itemupdating event with documnet library in sahrepoint

Posted on 2010-08-30
2
1,087 Views
Last Modified: 2012-05-10
Hii All Experts,
 First of all question tiltle is complecated to understand but i will try to explain my quetion properly.
I have sharepoint 2010. And i have one document library with item adding, item added item updating, item updated event. When i upload any document item adding and item added event call and code execute. after uploading when i update metadata(Custom columnss) , item updating , item updated event call. it works fine i wrote some code to generate Docnumber based on custom column.

Now when i open another documnet library and when i open document in word 2007 and when i click save as document to Another document library, item adding and item added event call, and then i can get documnet panel so when update some metada , again item adding and item added event call but not item updating event call. so i dont get docnumber.

I tried a lot for debug but no luck with execute item updating event. i dont know what to do?

So when user upload documnet than it works but when they save as documnet prolem with item updating event...

Hope you understand my question..

Thank you in advance
0
Comment
Question by:guessdip
2 Comments
 
LVL 8

Accepted Solution

by:
rseabird earned 500 total points
ID: 33566512
I have used item events also (only in MOSS), but I used the ItemUpdated and ItemAdded events.
Imho, those are better. You can do something like the piece of code below.
In this case, you edit the metadata after added or update, wiithout firing events and also without changing modified by and date.

DisableEventFiring();

try

{

   //do something with item (is a SPItem)

   item["column"] = ...;

   item.SystemUpdate(false);

}

finally

{

   EnableEventFiring();

}

Open in new window

0
 

Author Comment

by:guessdip
ID: 33569202
Hi,
 i have item added and alos item updated event. but all event works when we upload documnet. but when we use Save as method then only item added and item adding event works.
I will follow your code..
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
SharePoint Designer 2010 has tools and commands to do everything that can be done with web parts in the browser, and then some – except uploading a web part straight into a page that is edited in SPD. So, can it be done? Scenario For a recent pr…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

706 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

19 Experts available now in Live!

Get 1:1 Help Now