1

I have two document libraries, when I add an item the event reciver item added fires for one document library , but it does not for the other.

Rubinoff
  • 25
  • 1
  • 6
  • you have to show some code – Mahmoud Farahat Feb 09 '15 at 20:58
  • but the code works in one document library, the problem is when i add an item in the other document library, what information do you need? – Rubinoff Feb 09 '15 at 21:05
  • check if the event receiver is attached to the ListTemplateId of '101'. If you attach it to a specific list using 'ListUrl', It won't get triggered for other lists. You can also check the scope of the document libraries. – Saratchandra Feb 10 '15 at 09:19

2 Answers2

0

First of all follow Saratchandra advice in the comment.

Then get SPManager and find that list and see if it's attached, If it isn't it will probably relate to Saratchandra advice if it is attached check your ULS logs for errors

There are tools out there to attach event recievers manually so google around.

Cheers

Truez

Truezplaya
  • 1,315
  • 1
  • 13
  • 26
0

You can list event receivers attached to a list via PowerShell:

$spWeb = Get-SPWeb -Identity http://spserver/sites/Training
$spList = $spWeb.Lists["MyList"]
$spEventReceiver = $spList.EventReceivers

If your event receiver is there, then I would inspect the ULS log as probably some error occurs when the event is firing. If your event receiver is not attached, then you can also attach it manually using PowerShell:

$spWeb = Get-SPWeb -Identity http://spserver/sites/Training
$spList = $spWeb.Lists["MyList"]
$spEventReceiver = $spList.EventReceivers.Add()
$spEventReceiver.Assembly = "SharePoint.MyProject, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8b0aa81a0704748b"
$spEventReceiver.Class = "SharePoint.MyProject.MyEventReceiverClass"
$spEventReceiver.Type = 10001 // number of event receiver type's enum
$spEventReceiver.SequenceNumber = 1001
$spEventReceiver.Synchronization = 2
$spEventReceiver.Update()

Source: https://sharepoint247.wordpress.com/2013/06/27/how-to-add-custom-listlibrary-event-receiver-using-powershell/

Rafał Saltarski
  • 707
  • 1
  • 8
  • 20