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

10
votes
1answer
1k 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 ...
8
votes
2answers
1k 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 ...
7
votes
4answers
8k 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
1answer
254 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
4answers
17k 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 ...
6
votes
1answer
649 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 ...
6
votes
3answers
2k 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 ...
5
votes
1answer
1k 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 ...
5
votes
2answers
291 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
154 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 ...
5
votes
1answer
608 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 ...
5
votes
2answers
1k views

How do 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 ...
4
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. ...
4
votes
3answers
2k 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
663 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
242 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
2answers
542 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 ...
4
votes
2answers
1k 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
1k 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
167 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
4k 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
445 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
407 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
314 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
3answers
1k 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
644 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
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
365 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
1answer
110 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
213 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
484 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
511 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
87 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 ...
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
4answers
4k 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
2answers
790 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.
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
2answers
835 views

Dispose of SPItemEventProperties at the end of an event receiver?

Is there any need to call properties.Dispose(); at the end of an event receiver? Would this prevent memory leaks? Is this unnecessary? Is it best practice?
2
votes
2answers
2k views

Preventing users from deleting an item from a task list

I am using the ItemDeleting event receiver to prevent users from deleting items in a Task List. Currently, my code looks like: if (properties.ListTitle == "Project Intake Tasks") { ...
2
votes
2answers
254 views

SPQuery - Which fields (ViewFields) are required to Update the list item?

In an SPQuery, which fields are required to update a list item? SPQuery query = new SPQuery(); query.Query = @" <OrderBy> <FieldRef Name='ID' Ascending='true' /> ...
2
votes
2answers
501 views

Can the ItemAdding event be used in a Sandbox?

Can the ItemAdding event be used in a Sandbox? I need to perform a task when a Item is a added/adding, it has to be synchronous (item added is async so i cant use that). If i cant use the ...
2
votes
2answers
2k views

Event Receiver, Before and After properties

In an event receiver, Item Was Updated. I want to Compare the Moderation status on ListItems to perform some functionality.This is just some of the code. SPList list = web.Lists["DocLib"]; SPListItem ...
2
votes
2answers
3k views

event receivers and execution order

I am using some of these such as ItemAdded and ItemUpdated and I had altered the elements file to make this synchronous. I'm just curious as to what the order of execution is for all these handlers. ...
2
votes
2answers
349 views

Detect SystemUpdate() in an event receiver

Is it possible to detect whether SystemUpdate() or Update() has been invoked in an event receiver?
2
votes
2answers
297 views

Requiring Event Receiver while creating new item

I have an event receiver(item adding,item added)..on a custom list..this event receiver creates an ID when a new item is created..so when i deactivate the event receiver and add a new item to the list ...
2
votes
1answer
992 views

Sending an email using sharepoint object model sharepoint 2010

i have been working on generating email in an event receiver using share point object model..i used the sputility.sendemail method..2 things are necessary in the email(email from and HTML body)..so i ...
2
votes
2answers
823 views

Event Reciever on specific list in SharePoint 2010 working in dev environment but not in production

I have created an event receiver (on item adding) using VS2010 in SharePoint 2010 targeted to specific custom list which is a globally deployed in the production environment. This event receiver ...
2
votes
1answer
53 views

Recursive call for SPListItem Update method when called from a event receiver ItemUpdated

I have fallen in a serious problem about the SPListItem Update method. When I make a event receiver to intercept SPListItem change or update with SPItemEventReceiver ItemUpdated method, the event is ...