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)

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 ...
2
votes
1answer
2k views

Execution order of event receivers and workflow on a list

Is it possible to know beforehand whether event receivers on a list will always execute before any workflows associated with that list?
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 ...
2
votes
4answers
3k views

How does Sharepoint Online Event Receivers work?

I have created this Sandboxed Event Receiver on ItemAdding on a custom list. It works on my on-premise server, but it does not work on Sharepoint Online aka. O365. Anybody know how to create an ...
3
votes
3answers
5k 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 ...
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 ...
7
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 an ItemAdding event receiver for a document library as follows. But I ...
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
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 ...
1
vote
1answer
2k views

ListAdded Event Receiver not Firing for List Instances

I have a List definition in Visual Studio which is instantiated using a List Instance. This list definition has an event receiver which overrides the ListAdded event. I am able to get the ListAdded ...
0
votes
3answers
758 views

Prevent Item Overwrite Event Receiver

I want to prevent users from overwriting items that have the same name. When users add items to a library there is a checkbox indicating files should be overwritten if they have the same name. In ...
13
votes
1answer
615 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 ...
7
votes
1answer
850 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 ...
5
votes
3answers
4k 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 ...
1
vote
3answers
2k views

Redirect from ItemAdded event

I am using an ItemAdded event handler for doing some validation. If my validation fail is it possible to redirect the user to another page. Ideally it would be good to show the page in a dialog box. ...
1
vote
1answer
2k views

response redirect in event handler

I try to redirect user after edit a list to another page in site. So I write this code at the end of my item_updated list handler Response.Redirect("http://www.somewhere.com"); I pretty sure that ...
1
vote
1answer
2k views

properties.Cancel = true not firing in ItemAdded event

I developed a custom event receiver class that overrides the ItemAdded method after the list item is added I want to make some checks and based on a certain condition I want to delete the added item. ...
0
votes
1answer
4k 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 ...
0
votes
1answer
642 views

How to enable an Event Handler to intercept upload from email in document library

I have a Document Library with an email associated with the OOTB feature. When I send to the library an email with some attachments, every attachment is stored with one of the OOTB methods (divided in ...
0
votes
3answers
1k views

ItemAdding getting the file name of a document

I have a document library. I want to add an itemadding event recieiever to do some validation on the file name of the document. How can I get the file name from the SPItemEventProperties
0
votes
2answers
480 views

deploy a list with specific item-level permissions in ListAdded event receiver method

I have a certain type of custom list I have designed in my 'solution.wsp', that, whenever an instance of it is instantiated, it should have at the outset a specific Item-Level permission. To further ...
0
votes
2answers
3k views

ItemAdding event not firing when submitting InfoPath form to form library

I created an event receiver in Visual Studio to handle three events in a form library: ItemAdding, ItemUpdating, and ItemDeleting. ItemUpdating and ItemDeleting work as expected when debugging, but ...
0
votes
2answers
5k views

How to move an item from custom list root location to sub folder programmatically?

How to move an item from custom list root location to sub folder programmatically (in Event Receiver (ItemAdded))?