Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Problem with itemupdating event with documnet library in sahrepoint

Posted on 2010-08-30
2
Medium Priority
?
1,155 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 2000 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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

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…
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
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

604 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