locked
Event receiver: changing the library RRS feed

  • Question

  • Hi,

    I need to either deploy the event receiver to a different library from where is currently deployed on(InfoPath submit lib.) or just deploy it to multiple libararies, I changed the elemts.xml attribute (CDPR 2016 is the name of the lib that I need to deploy the wsp to) but the E.R. is still only working on the CDPR 2015 library only. Any help is much appreciated.

    Regards,

    Nemanja

    Elements.xml:

      <Receivers ListUrl="2016 CDPRs"> -- I changed all attributed to 2016 from 2015 - but E.R. still fires on 2015 lib
        <Receiver>
          <Name>CdprAddedReceiverItemCheckedIn</Name>
          <Type>ItemCheckedIn</Type>
          <Assembly>$SharePoint.Project.AssemblyFullName$</Assembly>
          <Class>Stantec.HR.Cdpr.EventReceiver.CdprAddedReceiver.CdprAddedReceiver</Class>
          <SequenceNumber>10000</SequenceNumber>
        </Receiver>
      </Receivers>
      <Receivers ListUrl="2016 CDPRs">
        <Receiver>
          <Name>CdprAddedReceiverItemCheckedIn</Name>
          <Type>ItemCheckedIn</Type>
          <Assembly>$SharePoint.Project.AssemblyFullName$</Assembly>
          <Class>Stantec.HR.Cdpr.EventReceiver.CdprAddedReceiver.CdprAddedReceiver</Class>
          <SequenceNumber>10000</SequenceNumber>
        </Receiver>
      </Receivers>
    <Receivers ListUrl="2016 CDPRs">
      <Receiver>
          <Name>CdprAddedReceiverItemCheckedIn</Name>
          <Type>ItemCheckedIn</Type>
          <Assembly>$SharePoint.Project.AssemblyFullName$</Assembly>
          <Class>Stantec.HR.Cdpr.EventReceiver.CdprAddedReceiver.CdprAddedReceiver</Class>
          <SequenceNumber>10000</SequenceNumber>
        </Receiver>
      </Receivers>
    </Elements>

     

    Nemnaja Sovic


    • Edited by Nemanja011 Friday, February 12, 2016 9:20 PM
    Friday, February 12, 2016 9:18 PM

Answers

All replies

  • You can deploy the ER without using the XML.  You can use PowerShell or C# using Server object model to add the event receiver to the required library.

    Check out this great resource below.

    http://www.sharepointdiary.com/2014/02/add-remove-get-event-receivers-in-sharepoint-using-powershell.html


    Jerry Yasir - Office Server & Services MVP/MCT Hewlett Packard Enterprise - If this reply helped you resolve your issue, please propose as answer. It may help other community members. Thanks!

    Friday, February 12, 2016 9:45 PM
  • Thank you for your answer, but I see that E.R. is working properly fro 2014 and 2015 library, and I know that it has been deployed without specifying libraries in power shell.


    Nemnaja Sovic

    Friday, February 12, 2016 9:52 PM
  • What is more this elements.xml is part of the solution so when I publish the E.R. it becomes part of the WSP file, correct?

    Nemnaja Sovic

    Friday, February 12, 2016 9:54 PM
  • Hi Nemanja,

    It seems there is a similiar thread posted by you, please check the thread below:

    https://social.msdn.microsoft.com/Forums/office/en-US/a6610b95-2f1c-4ca9-b72f-728ef2423adf/event-receive-deployment-to-additional-library?forum=sharepointdevelopment

    Thanks

    Best Regards


    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.

    Wednesday, March 2, 2016 2:19 AM