2

As per my requirement, I need to apply TWO event receivers on the same SPLIST, say "myLIST1".

The first event receiver is already written by my colleague.And I want to apply another set of functionality on the same "myLIST1" based on the change of a particular list column.[say targetresolutiondate].

If authorized person came to the SPLIST and change the targetresolutiondate column to a future date [ greater than today], I have to fetch this value and navigate it to another document library and manipulate some doc lib items' metadata.

I want to apply ItemUpdated()

3
  • So, is your question about whether it's possible to have two event receivers on the same list, or how to implement an event receiver which catches targetresolutiondate-column's value and if it's a date in the future, you do <something>?
    – moe
    Commented Jun 27, 2017 at 6:40
  • my question is, whether its possible to have two event receivers associated with the same SPList and not "HOW TO". whether SharePoint supports this kind of functionality in SSOM
    – samolpp2
    Commented Jun 27, 2017 at 7:57
  • 1
    I believe you'll find this helpful: sharepoint.stackexchange.com/questions/129392/…
    – moe
    Commented Jun 27, 2017 at 8:56

1 Answer 1

3

Yes, it's possible to have multiple event receivers on the same list, but why you need to do that? you can add the new event function Itemupdating to the current event receiver solution!

Regarding fetching

  • In case you need to fetch the old value use Itemupdating with properties.ListItem
  • In case you need to fetch the new value use Itemupdating with properties.AfterProperties or ItemUpdated as you like !!
6
  • I prefer itemupdated() eventhandler instead of itemupdating() with synchronous as the value in elements.xml file.
    – samolpp2
    Commented Jun 27, 2017 at 9:42
  • Bro, why you prefer that? to handle the synchronous use ItemUpdating instead of the ItemUpdated (asynchronous) event in order to access the old value Commented Jun 27, 2017 at 9:47
  • :-) in my case, authorized person will access this list and make changes to this field- targetresolutiondate - and set it as Future Date - and i need to compare this Future Date is Greater than Today's date. so i think i can directly access the currentlistitem["targetresolutiondate"] without using properties.afterproperties . I have tested similar functionality with itemupdated event. and it was working as expected.
    – samolpp2
    Commented Jun 27, 2017 at 10:20
  • Bro, this is not my point now, I talk about old value, in case you don't need to fetch it okay use itemupdated but as told you, you should distinguish between synchronous and asynchronous events. So I answered with additional info where you need to know only the possibility ?!! finally what's the wrong now in my answer!! :) Commented Jun 27, 2017 at 10:28
  • Sorry for the confusion! :-( I never said your answer is wrong. It was nice to see that , you are offering help and your time to let others learn the intricacies of SP. Thanks Again! :-)
    – samolpp2
    Commented Jun 27, 2017 at 10:33

Your Answer

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

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