0

Is it somehow possible to configure SharePoint on a test/debug environment so the order of execution of event receivers is orchestrated?

There are moments when a couple ItemUpdated events occur, or also ItemAdded and ItemUpdated, and the order of execution is not always the same.

Thanks in advance, Joao

1 Answer 1

0

If you developed the eventreceivers, you have defined something like this

<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <Receivers ListTemplateId="104">
    <Receiver>
      <Name>MyEventHandlers1</Name>
      <Type>ItemAdded</Type>
      <SequenceNumber>10</SequenceNumber>
      <Assembly>MyEventHandlers1, Version=1.0.0.0, Culture=neutral, PublicKeyToken=4358f2a5344ff0dc</Assembly>
      <Class>MyEventHandlers1.SimpleEventHandler</Class>
      <Data></Data>
      <Filter></Filter>
    </Receiver>
    <Receiver>
      <Name>MyEventHandlers2</Name>
      <Type>ItemAdded</Type>
      <SequenceNumber>10000</SequenceNumber>
      <Assembly>MyEventHandlers2, Version=1.0.0.0, Culture=neutral, PublicKeyToken=4358f2a5344ff0dc</Assembly>
      <Class>MyEventHandlers2.SimpleEventHandler</Class>
      <Data></Data>
      <Filter></Filter>
    </Receiver>
  </Receivers>
</Elements>

As you can see, both receivers are ItemAdded event receivers. The upper receiver has a much lower sequencenumber, which will tell the sharepoint server what event should run first.

I hope this will help you

1
  • I am the developer of the event receivers and I have set the Sequence number. However there are moments (e.g. dragging n' dropping) when SharePoint calls an event receiver multiple times. The order of the events isn't always the same. For example, sometimes ItemAdding, ItemUpdating, ItemAdding, ItemUpdating, other times ItemAdding, ItemAdding, ItemUpdating, ItemUpdating.
    – Joao Silva
    Nov 29, 2016 at 15:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.