Sunday 16 December 2018

Duplicate Event Recivers SharePoint 2013 Site Collection Level (Site Feature)


Issue Description:- SharePoint custom event receivers triggered twice. On folder creation custom event receiver triggered (On Item updating and On Item Updated) to perform set of task in folder level but due to twice event triggered our functionally break. After investigation, we found that duplicate event receiver entry present in site collection database table – [EventReceivers].



Resolution:-  Remove the duplicate entry from Site Collection database entry. Please find the below steps to remove the duplicate entry from database table.

  • Disable the feature   (Disable-SPFeature -Identity XXXXX -url http"//xxx/sites/xxx )

  • Find out the custom event receivers id from site collection level.

$siteEventID = Get-SPSite http"//xxx/sites/xxx

$siteEventID.EventReceivers | Select Id, Name

  • Delete event id from site collection level.

$site = Get-SPSite http"//xxx/sites/xxx

$event_updating =$site.EventReceivers | ?{$_.ID -eq "xxxxx"}

$event_updated =$site.EventReceivers | ?{$_.ID -eq "xxxxx"}

$event_updating.Delete()

$event_updated.Delete()

  • Enable the feature (Enable-SPFeature -Identity XXXXX -url http"//xxx/sites/xxx )

No comments:

Post a Comment