Solved

Problem with itemupdating event with documnet library in sahrepoint

Posted on 2010-08-30
2
1,110 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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

I thought I'd write this up for anyone who has a request to create an anonymous whistle-blower-type submission form created using SharePoint 2010 (this would probably work the same for 2013). It's not 100% fool-proof but it's as close as you can get…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

785 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