ItemAdded triggers three times

1k views Asked by At

I added an ItemAdded eventreceiver for a SharePoint document library programmatically and everything works fine on my computer. I checked in my code and my colleague got the latest code from our TFS, built the project and tested it.

On my colleague's computer the ItemAdded event triggers three times when he adds a document from the SharePoint GUI.

On my computer it only triggers once as it should.

Have you seen something similar and do you know how to solve it?

3

There are 3 answers

0
Thorsten Hans On

do you have the similar contenttypes on the list? I remember an issue that various events will be fired once per conenttype on the list.

Workaround is to check the contenttype of the current item by using

properties.ListItem[SPBuiltInFieldId.ContentTypeId]

This workaround is working fine in our solution. Somewhere on MSDN i found an article describing that issue. Actually I can't remember the exact link. Sry

thorsten

0
Sandeep On

I will recommend sharing code on ItemAdded.

Also as long it works ok on most of ur machines and issue is with 1 machine , you are good.. Just get a new site collection , retract-delete solution fully , IISReset and deploy the solution again

0
Neeraj Aggarwal On

I found that after removing multiple upload link in upload popup, then it is calling itemadding event only once