Event Receivers are a piece of managed code that responds to SharePoint events when specific triggering actions occur on a SharePoint object.

learn more… | top users | synonyms

13
votes
1answer
2k views

Is Calling base.ItemUpdating(properties); necessary?

In an event receiver, is it necessary to call base.ItemAdding(properties);, base.ItemUpdating(properties);, etc. at the beginning of your event handler? I've seen people arguing that it isn't ...
9
votes
2answers
2k views

What is the difference between properties.OpenWeb() and properties.Web?

I am developing an event receiver, using the ItemUpdating event, and I noticed that the properties parameter has an "OpenWeb" method, with this description: Retrieves the Web site that is ...
8
votes
4answers
10k views

Creating a Site collection programmatically throws exception <nativehr>0x80070005</nativehr>

I'm migrating a SharePoint customization from MOSS 2007 to SharePoint Server 2010 (Win 2008), which creates the Site Collection programmatically. Problem is I'm unable to create the Site Collection ...
7
votes
2answers
1k views

Event Reciever on specific list in sharepoint 2010

I am working on creating event reciever for a custom list in sharepoint 2010 using visual studio..how can this event reciever be targeted to a specific custom list ..in my case its customEmpList?
7
votes
4answers
20k views

Error occurred in deployment step 'Activate Features': <nativehr>0x80070002</nativehr><nativestack></nativestack>

I have a feature. On the FeatureActivated event I am creating a list if it is not there. I also have an EventReceiver that in the elements.xml on the Receivers node has the attribute ListUrl. This is ...
7
votes
4answers
8k views

Race condition in SPListEventReceiver.ListAdded - Save Conflict

I am currently developing an Event Handler for SharePoint 2010 which sets defaults for Document Libraries on creation (content types, version settings etc). I am having a problem with Save Conflicts ...
7
votes
1answer
820 views

Client Object Model SystemUpdate

I need to have the SystemUpdate functionality from the Client Object Model. Is there any way I can do it since the ListItem.SystemUpdate() does not exist? Another solution would be to disable the ...
7
votes
3answers
3k views

Workflow and EventReceiver execution order

I have an event receiver, and I'm capturing the "ED" events (Added, Edited). I also have a Workflow on the list that is triggered on Item Added and Updated. Does the workflow get called before the ...
7
votes
1answer
281 views

How to know if another event / user is running on an SPListItem (Sharepoint 2010)

I have a Sharepoint 2010 farm in which is deployed my solution. This solution provides some "data mantain" of some content types. Let me explain: Suppose I add a file in a document library: when I ...
6
votes
1answer
2k views

SPListItem.SystemUpdate(false) is still triggering alerts

Environment: SP2010 Enterprise, VS2012, c#, full server access Simple question... I'm using a console app to create sub-folders in a document library based on user input, then calling ...
6
votes
2answers
807 views

How can I tell if a document is 'being published'?

I need to use the relevant event receiver to tell if a document is being published, is this possible? I will settle for has 'just been published' - i.e. I have no preference between itemupdating and ...
6
votes
2answers
1k views

Programmatically determine when Approval workflow has completed

I have a list with 2x declarative approval workflows associated with it (the workflows themselves are copies of the OOTB Approval workflow and were built in SharePoint Designer 2010). FYI: The ...
5
votes
2answers
2k views

Event Receiver behaving unexpectedly

I have created a list item event receiver(ItemUpdated). When a item is updated in a list(for which event handler is attached),my code updates other items (may be more than 1) in lists in subsites. ...
5
votes
2answers
659 views

Instantiating SPListItems in Event Receivers - Best Practices

In the MSDN article Best Practices with Event Receivers it is clearly stated: Do not instantiate an SPWeb, SPSite, SPList, or SPListItem object within an event receiver. The article goes on to ...
5
votes
2answers
299 views

How to add style library event receivers?

how can I add an event receiver to the style library ? (can't find any templateid) thank you ;)
5
votes
2answers
258 views

Does Updated event always fire after Added event?

I have an interesting question about event receivers. I have long running ItemAdded event. But as soon as item is saved, another or the same user can edit it, even before async event finished. The ...
4
votes
3answers
3k views

How to add event receivers to all the lists in a site collection?

What is the best practice around adding event receivers across all the lists in a Site Collection?
4
votes
4answers
1k views

Event Receiver called multiple times

I attached an event handler for ItemAdded to a content type A in the xml (using XmlDocuments). I have 4 other content types A1, A2, A3 and A4 that inherit from content type A (in their xml definition ...
4
votes
1answer
5k views

How to get a field value of the item in ItemDeleted event handler?

I need to get the value of ListItem field in ItemDeleted event handler. Only value of one numeric field. But properties.ListItem == null. And AfterProperties, BeforeProperties also do not work. Is ...
4
votes
1answer
414 views

Farm scope Event Receiver

For some security reasons on one of our farm level solutions, we need to limit some actions using Event Receiver-FileMoving event. However, as known, event receivers can be deployed only by Site or ...
4
votes
1answer
65 views

Synchronous ItemAdded event. Do I need to explicitly call properties.Dispose()?

We have a SharePoint 2010 On-Prem solution. I have an ItemAdded event receiver which has been made synchronous using the Synchronization property. Now, when this event receiver fires, I have used the ...
4
votes
1answer
654 views

WebProvisioned event receiver is firing twice

I am creating a SharePoint site from code behind using SharePoint object model. In the WebProvisioned event, I am creating the groups, enabling a few features. Everything is working fine, except the ...
4
votes
2answers
2k views

Webprovisioned not fire

I have a code from external developer that creates site in list event receiver. public override void ItemAdded(SPItemEventProperties properties) { bool EventFiringEnabledStatus = ...
3
votes
6answers
2k views

Logged in user name in SharePoint 2010

I am trying to retrieve the display name('firstname lastname') of a user who logs in the SharePoint site. When I log into my SharePoint site I could see at the top right --'domain/user name'. So when ...
3
votes
1answer
241 views

Is it possible to wait until my file is uploaded in document library?

I have created a document library and I have applied an Item Added event receiver to that library which will copy that file to another library and I have added that library as a mapped drive to my ...
3
votes
3answers
5k views

Get list of event receivers registered for a list created from a list definition

I created a list definition created from visual studio. I also have an event receiver specified along with the listtemplate feature. The idea was to have event receiver registered for all lists ...
3
votes
1answer
871 views

Unable to find Event Receiver template in Visual Studio 2012

This would probably be right under my nose but I am having a hard time finding it. I am trying to create an event receiver in Visual Studio 2012. From this video in YouTube I gather that in Visual ...
3
votes
3answers
450 views

Add file watermark as it's uploaded

I've been trying to add a watermark to files as they are uploaded to SharePoint. I tried using several events: ItemAdding, ItemUpdating, ItemCheckedIn. In ItemUpdating and ItemCheckedIn the file is ...
3
votes
1answer
318 views

Event receiver in SharePoint 2010

I am working on creating an event receiver. Does SharePoint have a stipulation that the event receiver should be a farm solution or a sandbox solution?
3
votes
4answers
2k views

Event Reciever ItemAdded fired twice

I'm trying to do some treatement after creating an item but the treatement is done twice because in my code after creating the item, I'm updating it , so the event reciever get fired twice: first when ...
3
votes
1answer
710 views

How to remove duplicate EventReceiver entries

Lately i had a bug that time-to-time added duplicate event receiver entries in SPEventReceiverDefinitionCollection. So how do i easily enumerate and remove these duplicate entries?
3
votes
1answer
2k views

Event Receiver on SharePoint-hosted Apps

Is it possible to create event receiver or workflow on SharePoint-hosted apps in SharePoint 2013? I have not much knowledge about SharePoint apps. If yes then how to create it... Can we use Remote ...
3
votes
2answers
2k views

One Event Receiver for many lists

I have Event Receiver for document library. It is added in Elements.xml like this: <Receivers ListTemplateId="101"> I would like to use this ER for all my document libraries. Do I have to ...
3
votes
1answer
718 views

Event manager error: Could not load file or assembly - Solution has been retracted

I have a wsp which basically contains a Workflow and an Event Receiver (Item Updating). I deployed it, and then had to retract the solution. Now I'm getting an error every time I try to update an ...
3
votes
2answers
1k views

Move a document from library after adding it

I am using the ItemAdded event to fill in a metadata field. In the ItemUpdated event (after submitting the file properties diagog) - I want to move the file elsewhere. However, I get an error saying ...
3
votes
1answer
75 views

SharePoint 2013 app uninstalling behaviour

I have been seeing change of behavior on O365 when app is uninstalled. Not sure if anybody experienced the same. Let me explain, App Uninstall behavior before: When app is uninstalled, SharePoint ...
3
votes
1answer
354 views

Event Receiver - Cannot access item from Document Library if the user changed the name

I have a library, that has versioning enabled. On that library is an event receiver that does stuff, on ItemUpdated. Ok, if the user uploads a document, and does not rename the document during the ...
3
votes
1answer
130 views

Document in library: newly created from template OR uploaded?

Can I programmatically detect if a document in a library is uploaded or created with the "new document" button? When a user uses the "new document" button, my ItemUpdated event receiver doesnt fire, ...
3
votes
1answer
5k views

Feature activation error: System.InvalidOperationException: Operation is not valid due to the current state of the object

i have taken one List Email event receiver(Type is EmailReceived) and that event receiver attach with document library. when i am activate that feature got error. i have check on ULS Viewer. error ...
3
votes
1answer
229 views

ItemUpdating method for an item event reciever is called three times

I've creted an asset library for holding pictures and I've created an event reciever for the ItemUpdating event. When the item is updated, the method is called three times(!?!). I've noticed that two ...
3
votes
1answer
499 views

How can an InfoPath form get the Claims of the user who is logged in to SharePoint?

We have a document library that contains a list of proposals (InfoPath Forms). Users log in through SharePoint using Claims (Forms Auth, via an Extranet) who are from various organizations. The ...
3
votes
1answer
559 views

Access denied for BCS method in e-mail event receiver

I have a SPItemEventReceiver which does some stuff with an external list when a document is uploaded to a DocLib. I now wanted to have it also run when an e-mail is sent to that DocLib. I could have ...
3
votes
1answer
238 views

Custom master page will not locate spfont file

I have a project that has a custom master page created from seattle.master. The only change in the .master file is the addition of a <SharePoint:ScriptLink> tag pointing to a copy of d3.min.js ...
3
votes
2answers
2k views

Redirect in Event receiver SharePoint 2013

My question was simple in SharePoint 2010 but in SharePoint 2013 is complicated! In 2010 I could redirect user by setting properties.Status and properties.RedirectUrl. Now RedirectUrl and ...
2
votes
4answers
2k views

Event Reciever firing twice sharepoint 2010

Hi I have a event receiver(item adding,item editing,item added), it was working fine before ...now it has started to fire twice...any suggestions?
2
votes
1answer
2k views

Event Reciever run with elevated previledges

I created one event receiver and deployed it, but only users who are site collection admins are able to view this web part. I have included the SPSecurity.RunWithElevatedPrivileges but the same thing. ...
2
votes
1answer
2k views

ItemUpdating not saving field values

A user has a list that has a couple fields that are often updated. He wants to store the prior values in some other fields on the item when the item is updated (yes, I know versioning would be ...
2
votes
4answers
5k views

Item added or item edited Sharepoint 2010 event receiver

I am working on Sharepoint list form with 10 fields. The first time when I add the new item I fill in 8 values and id is generated. Next time I edit the form I fill in the one of the two remaining ...
2
votes
3answers
83 views

Why is my app's UninstallingEventEndpoint never invoked during app removal?

I have a provider-hosted sharepoint app with an appmanifest.xml that looks something like this: <Properties> <Title>My app title</Title> <StartPage> ...
2
votes
2answers
880 views

Attach an event receiver to profile property update

Do someone know if it's possible to attach an event receiver to profile updates? The goal would be to update an external system (such as a CRM) when a user is updating his profile.