Solved

Problem with itemupdating event with documnet library in sahrepoint

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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

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…
A recent project that involved parsing Tableau Desktop and Server log files to extract reusable user queries for use in other systems. I chose to use PowerShell to gather the data, and SharePoint to present it...
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

691 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