Event handlers is a program statement which is called from an event. The event can be a human striking a key on the keyboard or pushing a button on a web page

learn more… | top users | synonyms (1)

13
votes
8answers
4k views

Content Type Event Receivers Impossible to Remove

I have a very odd situation in my SharePoint staging environment. We recently stood up a new SharePoint 2010 server (single WFE + a DB server), and attached a backed-up content database from our ...
11
votes
8answers
7k views

Event Receiver Firing for all Lists - even when ListUrl is set

I have two custom list definitions - List 1 and List 2, both with different ID's for the Type in the elements.xml. List 1 is called 'List1' and the other is called 'List 2', note that the second list ...
11
votes
2answers
896 views

Why is my workflow DependencyProperty event handler not firing?

I have a custom workflow activity (SharePoint 2010) with a Dependency Property defined as follows: public static DependencyProperty TaskChangedEventPropertyEvent = ...
11
votes
1answer
556 views

Memory leak in Microsoft.Sharepoint.Taxonomy.TaxonomyItemEventReceivers?

I've been trying to locate some memory leaks we've noticed in our ULS (EventID: nask, An SPRequest object was not disposed ... etc). On my dev environment, and at least 2 other cleaner installs, the ...
10
votes
2answers
862 views

What happens if an earlier Event Receiver throws an error?

Let's say I set up an ItemAdded event receiver with a sequence number of 12345. On this list there're two other event receivers that run before it; one for ItemAdding, and an earlier one for ...
8
votes
3answers
4k views

Event handler vs. event receiver

http://msdn.microsoft.com/en-us/library/ms453149.aspx says To create the event handler 1. Start Microsoft Visual Studio 2010. 2. On the File menu, point to New, and then click Project. 3. In Project ...
8
votes
4answers
559 views

Save metadata on this list as social tags

On the UI, for a document Library settings, under "Enterprise Metadata and Keywords Settings" there is an option to "Save metadata on this list as social tags" Is there a way to activate this, ...
8
votes
1answer
1k views

Event handlers on User Information List

Has anyone ever tried adding an event handler to the User Information List of a site collection? Or for that matter, an alert? I'd try it out, but was just wondering if there were any issues I should ...
8
votes
1answer
3k views

Which process do event receivers run under?

Some MSDN articles say that synchronous event receivers run under w3wp.exe, and asynchronous event receivers run under owstimer.exe. For eg, this one: ...
7
votes
1answer
789 views

Where to load data in the lifecycle of custom webpart

I have a webpart where I access a sharepoint list and render contents of that list. At the moment I'm fetching the data in CreateChildControls(). When a button is clicked the data will be fetched ...
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
3answers
9k views

How can I detect whether a specific column changed in an SPItemEventReceiver.ItemUpdated event (SP 2010)?

I've got some code I need to run in an ItemUpdated event receiver method, but only if the value in specific column changed during the update. My initial thought is to also implement some code to grab ...
6
votes
2answers
2k views

Preventing document Uploading to Document Library in SharePoint 2010

Here is my scenario. I would like to allow the only certain file types (doc,docx,pdf,ppt,pptx) into my document library. I wrote ItemAdding event receiver for document library as follows. but i am ...
6
votes
2answers
3k views

SPItemEventReceiver ItemUpdating and BeforeProperties / AfterProperties

I've bound and ItemUpdating event to a document library of a MOSS publishing site, I’m then trying to compare the Before and After properties. When I amend the field in the UI I expect the two values ...
5
votes
2answers
2k views

SystemUpdate(false) using SPWeb.ProcessBatchData()

Is it possible to use SPWeb.ProcessBatchData() and not trigger all the event handlers attached to a list? I would like to process a large list in quick time, but I don't want all the event handlers ...
5
votes
1answer
2k views

ItemUpdated event handler runs four times

I have a list in the rootweb, and a list in a subweb. I want to update/add when something changes in an item in the subweb. This method is invoked in an ItemUpdated event receiver. The problem is that ...
5
votes
3answers
3k views

Deploying EventReceiver project with target of WebApplication from VS fails when activating features

I am trying to deploy an event receivers project with a deployment target of WebApplication as part of my web parts package (also has a target of WebApplication) through Visual Studio and encountering ...
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
5answers
2k views

ItemAdded event receiver is not firing

My ItemAdded event recevier is not firing when the Word Automation Services adds a file to a Sharepoint document library. If I manually debug the ItemAdded event receiver, it is getting triggered. I ...
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
1answer
1k views

Adding a list item with PowerShell doesn't trigger event receiver

I have a simple list with an event receiver for the following events: ItemAdded ItemUpdating ItemDeleting I confirmed that the event receiver fires when adding/updating/deleting an item from the ...
4
votes
4answers
3k views

SPItemEventReceiver ItemAdding - Differentiate between a file and a folder

I've setup a custom event receiver. The purpose of my event receiver is to stop people from uploading any file type except PDF's. Right now my code looks like this: if ...
4
votes
1answer
510 views

Enlarge Newsfeed images on SharePoint 2013

I am a bit stumped why I have not found much information on this topic or why no one is asking the question. Maybe it is just not possible. My question being: Are you able to enlarge Newsfeed images ...
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
2answers
1k views

How to target events to different types of document libraries?

I have the requirement for multiple document libraries. Each document library will contain the same types of document, images, office documents; however, when items are added to the library, a custom ...
4
votes
4answers
1k views

Web Template - Receivers Not Firing

I have a custom web template used to provision site collections that activates features with onet.xml and is deployed as a farm solution. I've tried both feature receivers and event receivers (on ...
4
votes
1answer
525 views

In a document library itemUpdated event receiver, how to tell if a file was just modified?

How do I know if it is the file being updated? Since it could just be the item properties. Thank you.
4
votes
1answer
1k views

Is there a way to enable and configure incoming email for a document library using the C# api for sharepoint 2010

I've got a requirement to allow users to approve or disapprove certain actions by replying to auto generated emails. I've already got a good handle on how to use email enabled lists and event ...
3
votes
3answers
2k views

Unable to modify SPWebApplication properties from feature receiver - Access Denied

The scope of the feature is Web. SPWeb site = (SPWeb)properties.Feature.Parent; site.AllowUnsafeUpdates = true; // Set the Web Application's default error page SPSite siteCollection = new ...
3
votes
2answers
1k views

How do I handle concurrency problems related to event receivers?

This is a problem that seems to pop up all the time, so I'm wondering if there is an authoritative answer somewhere. I'm using an event receiver (specifically, the ItemUpdated receiverthrough the ...
3
votes
1answer
3k views

How to disable event firing outside an event?

How do I disable event firing in code that is not part of an ItemReceiver? E.g.: I have an FeatureActivated event receiver which update a list (adds column) and updates all items to populate the new ...
3
votes
1answer
2k views

What is the scope of DisableEventFiring()?

When I call DisableEventFiring() what events are blocked? All events? On the current item? All events using the current EventReceiver? What happens if two threads change one item and one ...
3
votes
1answer
678 views

Determine if a document library is a sharepoint library

I'm adding some content types to every standard-document library which is created over the "List Added"-EventReceiver. When a web is created the are some new doclibs for example in a team site there ...
3
votes
2answers
145 views

eventHandler only works for admin

It appears that my eventHandler only seems to receive the event when an Admin user updates a document on the list. Ive used the event manager made by brian wilson to register the event. Does anyone ...
3
votes
3answers
68 views

Delete the item once it is added

I want to perform some Action once the item is added. I have a Custom List that reacts on Item Creation. If, at this level, i want to Delete the item immediately once it is added, how could I do? ...
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
3answers
1k views

How to create Site (SPWeb) on Sharepoint Online

I have a problem creating Sites on Sharepoint Online. The code that works on-premise do not work on Sharepoint Online. I do not want to bother you with the code, i just want a clean start. So my ...
3
votes
1answer
811 views

ItemAdding event on list item to target a specific custom list

I have an ItemAdding event handler created and targeted to a Custom List. The event receiver seems to be firing on all custom list on the site. I wonder if I should target it to a specific custom ...
3
votes
2answers
3k views

How to display errors in Event Receivers?

I am trying to implement a custom logic during the checkout of an item of a list in SharePoint 2010. For this reason I added an Event Receiver that ovverides the method ItemCheckedOut. The idea is ...
3
votes
1answer
285 views

Listadded events on My Site omits Personal and Shared Documents creation

I want to have a feature which will change some settings on every list on My Site. Problem is i cant change settings for two main list: Shared and Personal Documents. For testing I have web feature ...
3
votes
1answer
117 views

Custom numbering scheme for document libraries

I need to create an event handler for a document library that will give custom Id's to documents and folders in it. The top folders will be prefixed with capital letters, folders and documents in ...
3
votes
1answer
182 views

Error building a content type in SP 2007

I have an event handler that catches an ItemAdding event and changes the content type on the fly. This is my code to build the content type: SPContentType baseContentType = ...
3
votes
3answers
4k views

How to get current logged user in event receivers?

I need to get the information about the user actually logged (as SPUser) inside an event receivers. The following line: Dim currentUser As SPUser = SPContext.Current.Web.CurrentUser does not work ...
3
votes
4answers
3k views

Get ContentType in ItemAdding Event Handler

I need to change a field in the item being added based on its content type. This needs to happen before the item has been added - hence ItemAdding event receiver. Using ItemAdded is no good since the ...
3
votes
1answer
335 views

SPFile object not correct/updated/propagated in ItemAdded of my event receiver - after the first time

I have a form library with a custom form associated. A user clicks "New form", inputs data in the form, and the form is saved to the library. Meanwhile, my logic in the eventreceivers generate a Word ...
3
votes
0answers
31 views

Ascertain the method of file upload in SharePoint 2013 document library?

In an ItemAdded event receiver, is there a way to ascertain whether the file was uploaded via the "new item" button in the document library or whether it was dragged and dropped into the browser ...
2
votes
5answers
4k views

Custom Event Receiver - Copy To Folder

I am in the process of writing a custom event receiver. The basic flow is as follows: Document is added to Library Based on metadata of document, we check to see if a folder within another document ...
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
2answers
2k views

How do I get an SPSite from SPWebEventProperties?

How do I get an SPSite object from the SPWebEventProperties object passed into the SPWebEventReceiver.WebProvisioned method? public override void WebProvisioned(SPWebEventProperties properties)
2
votes
6answers
4k views

How can I auto-increment a column?

I am working on a solution where I have a list with a column named LogIDNumber. For each new entry in the list, I would like to increment the LogIDNumber by one. I could use the ID generated by ...