eventreceiver

Error registering SharePoint WebDeleting event receiver in some environments

I am trying to register a WebDeleting event receiver within SharePoint. This works fine in my development environment, but not in several staging environments. The error I get back is "Value does not fall within the expected range.". Here is the code I use: SPSecurity.RunWithElevatedPrivileges(delegate() { using (SPSite elevatedS...

Event receiver on Content Type not triggered on WikiPageLibrary

Hello all, I created a new content type for a wiki page library. I added this content type to library by code (the interface did not allow this). Next, I added an event receiver to this content type (on ItemAdded and ItemAdding). My problem is that no event is trrigered. If I add this events directly to the wiki page library all works ...

SharePoint itemDeleting evert is not working

Hi! I have a site in SharePoint and I want to custom delete from a list. So, I'm creating the public class ListItemEventReceiver : SPItemEventReceiver { public override void ItemDeleting(SPItemEventProperties properties) { if (properties.ListTitle.Equals("Projects List")) { Projects pr...

SharePoint form-based authentication problem with itemDeleting event?

Hi! I have a SharePoint site (I'm the farm administrator with full control over the farm and site) and I used Windows authentication. I had a event receiver feature installed which manage add/update/delete for my lists to have custom behavior. Everything worked ok on Windows Authentication. But... now I am using form-based authenticati...

Creating excel document as attachment on a sharepoint list

Hi, I've got some problems adding a excel document as attachment on a custom list. I've made an eventreceiver which collects data from other lists and puts the data into an excel document. What i've tried to do to correct the problem: tested CreateContentRow(index, item) in a separate console application (works) checked if theres som...

how can I add event receiver only for list with specyfic template id

Hi, I'm adding ItemAdding event receiver for custom list template. Both event receiver and list template are deployed by the same feature. Also the same feature creates List Instances. The problem I've got is that the event is fired for each list item in site to which it was deployed. Elements.xml for eventreceivre is: <Receivers Lis...

Getting value from SPFieldBoolean

How do I get the value from a SPFieldBoolean object? Do I simply cast it to a boolean or do I need to do something further with it? I am fetching it in an EventReceiver class during an ItemAdded event from properties.ListItem["fieldname"]. If there is a chance the field might not exist (and be null), how do I check for that? ...

Adding a SharePoint feature with multiple class files

I am in the process of making a feature that consists of multiple items. Currently it contains a Feature.xml file with 4 ElementManifest entries; two for a specific contenttype (Field definitions and FieldRefs), one for some webparts and the last is for a custom pagelayout. All of that is working fine. I have altered the file with the ...