Skip to main content
Revised answer to suit revised question
Source Link
Jack
  • 261
  • 1
  • 6

Item Event Receivers are intendedUpdated to match revised question

The lifetime of an event receiver object is for the action occurring. For example, if you were to override the ItemAdding event you intercept the item as it is before it is added. Obviously an item can only be tied to a List Templateadded once, so that every list of type hasItemAdding (before it is actually added) and ItemAdded (immediately after its items actadded) will only execute once.

OnUpdated events will occur anytime the same wayitem is changed. Since they are deployed via visual studios This would include files being renamed, they show upmetadata being added to the item by web applicationupdating fields, and can be deployed ator updating the site collection leveldocument.

SharePoint Declarative Workflows Items can be attached to Content Typesupdated multiple times, which can be used at the web levelso this event will fire every time. Or they can bet attached It will not fire at an individual list.

That's deploymentthe same time as ItemAdded.

To suit your scenario, you would want to use the ItemAdding event receiver fires for EVERYto capture the item in a list based off of which event you've overridden. e.gand document prior to it being added to the library. OnItemAdded, OnItemAdding, OnItemChanged, OnItemChanging You can then contact your 3rd party software, OnItemDeletedreceive the metadata, OnItemDeleting

Trying to be clear. I add my itemthe metadata to the list that has 1000 items already. The even receiver fires for that one item. It doesn't do anything to, then allow the other existing itemsprocedure to continue.

If I open up a spreadsheet view ofSince the list, and copy and paste a change to 50 items at once, and myItemAdding or ItemAdded event receiver overrides OnItemChanged, then it will fire for each ofonly fires when the 50 items changeddocument is originally added to the library, you don't have to worry about multiple outside calls.

ItemAdding Event Receiver on MSDN

Item Event Receivers are intended to be tied to a List Template, so that every list of type has its items act the same way. Since they are deployed via visual studios, they show up by web application, and can be deployed at the site collection level.

SharePoint Declarative Workflows can be attached to Content Types, which can be used at the web level. Or they can bet attached at an individual list.

That's deployment.

the event receiver fires for EVERY item in a list based off of which event you've overridden. e.g. OnItemAdded, OnItemAdding, OnItemChanged, OnItemChanging, OnItemDeleted, OnItemDeleting

Trying to be clear. I add my item to the list that has 1000 items already. The even receiver fires for that one item. It doesn't do anything to the other existing items.

If I open up a spreadsheet view of the list, and copy and paste a change to 50 items at once, and my event receiver overrides OnItemChanged, then it will fire for each of the 50 items changed.

Updated to match revised question

The lifetime of an event receiver object is for the action occurring. For example, if you were to override the ItemAdding event you intercept the item as it is before it is added. Obviously an item can only be added once, so ItemAdding (before it is actually added) and ItemAdded (immediately after its added) will only execute once.

OnUpdated events will occur anytime the item is changed. This would include files being renamed, metadata being added to the item by updating fields, or updating the document. Items can be updated multiple times, so this event will fire every time. It will not fire at the same time as ItemAdded.

To suit your scenario, you would want to use the ItemAdding event to capture the item and document prior to it being added to the library. You can then contact your 3rd party software, receive the metadata, add the metadata to the item, then allow the procedure to continue.

Since the ItemAdding or ItemAdded event only fires when the document is originally added to the library, you don't have to worry about multiple outside calls.

ItemAdding Event Receiver on MSDN

Source Link
Jack
  • 261
  • 1
  • 6

Item Event Receivers are intended to be tied to a List Template, so that every list of type has its items act the same way. Since they are deployed via visual studios, they show up by web application, and can be deployed at the site collection level.

SharePoint Declarative Workflows can be attached to Content Types, which can be used at the web level. Or they can bet attached at an individual list.

That's deployment.

the event receiver fires for EVERY item in a list based off of which event you've overridden. e.g. OnItemAdded, OnItemAdding, OnItemChanged, OnItemChanging, OnItemDeleted, OnItemDeleting

Trying to be clear. I add my item to the list that has 1000 items already. The even receiver fires for that one item. It doesn't do anything to the other existing items.

If I open up a spreadsheet view of the list, and copy and paste a change to 50 items at once, and my event receiver overrides OnItemChanged, then it will fire for each of the 50 items changed.