.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Cannot enforce relationship behavior on Event List

Posted By:      Posted Date: October 27, 2010    Points: 0   Category :SharePoint

I have an event list, to which I have added a Lookup column.  I want to enforce relationship behavior between the two lists.  (Specifically, I want to enforce cascading delete, but I encounter the same problem if I try Restrict Delete instead.)  When I try to do so, I get the following error:

[COMException (0x8107059f): <nativehr>0x8107059f</nativehr><nativestack></nativestack>This lookup field cannot enforce a relationship behavior because this list contains incompatible fields.]

Using the same lookup field on other lists, it works fine; I have only encountered this problem on an event list.  How can I avoid this error, or at least figure out which field is incompatible?


View Complete Post

More Related Resource Links

Sharepoint 2010 List Added Event Problem

Hi All, I have created List Added Event Handler. In that Event I want to Add Custom Field in List as List is created. I get an Error "The Specified Program Requires    a newer version of windows" Is there ant solution for it. I have tried it also creating new instances of spweb and spsite rather than getting it from "Properties" Thanks Saumil Thakkar

how to get values of list item being entered in ItemAdding event handler?

Hi,          i am trying to get the values being entered in a listitem in the ItemAdding eventhandler as follows, but it doesnt work. public override void ItemAdding(SPItemEventProperties properties)         {             base.ItemAdding(properties);             SPSite CurrentSite = new SPSite("http://mm-moss/np/");             SPWeb CurrentWeb = properties.OpenWeb();             SPList CurrentList = CurrentWeb.Lists[properties.ListId];             string vehicleNo = CurrentList.Items[CurrentList.Items.Count - 1]["Vehicle No"].ToString();             string  name=CurrentList.Items[CurrentList.Items.Count-1]["Name"].ToString(); } when i debug i cant get hold of the VehicleNo value. canyone help me in getting the values of the list item being entered? Thank you all.

List Event Receivers firing for all custom lists

Hello, I have a site with two custom lists, and I have created an EventReceiver class to handle the ItemAdded event for custom lists. I have modified the EventReceiver's Elements.xml file to only handle items added to one of the custom lists instead of all custom lists, by changing: <Receivers ListTemplateId="100"> to <Receivers ListUrl="/Lists/MyCustomList">   however, when debugging, the ItemAdded method is being fired when an item is added in both custom lists. I have had to work around this by checking within the ItemAdded method for the list that fired the event:        public override void ItemAdded(SPItemEventProperties properties)        {            base.ItemAdded(properties);            if (properties.ListTitle.Equals("My Custom List")) { ... } I thought the ListUrl attribute of the Receivers element specifies the event to only fire for the specific list with that url? (see http://msdn.microsoft.com/en-us/library/ms431081.aspx). Is there somewhere else I should be checking?   Thanks

Custom Page Template (List.aspx) - one to many relationship


Hi, I have two tables which is Customer and Customer Details table, with one to many details.

Is there possible to show Child table's column in (done in one GridView) Customers/Lisp.aspx?

Bind Event Receiver to List Dynamically


Hey all, I've been working on a little application page that will give users the option to say whether a list should allow duplicate title entries.

I am able to pass the current list GUID to the application page using this:

<UrlAction Url="~site/_layouts/preventduplicates.aspx?List={ListId}"/>

within a custom action which I've added to the list settings. I'm kind of stuck now....


I'm not sure how to grab this GUID out of the url, and use it so I can bind the current list with my event receiver. Every example I've seen of binding has used a hard coded list name which is fine as an example, but isn't the best for real applications. Or is there a way to use the GUID to get the lists name which I can then pass to the spweb.Lists[var] ? Since I won't know the list name beforehand.

Hope all of that makes sense, any suggestions are appreciated.

Button On client click event Loads Drop Down List


Hello All


Right now my ASP page has a text box and a submit button, what I am trying to do is once the user hits the submit button load a drop down list.


The drop down list should not be visible before the submit button is pressed


Thanks in advance 

MVC2 Convention for Many-to-Many Relationship and Checkbox List?


I have a many-to-many relationship in my database (and Entity Framework Model) as follows:


Can anyone tell me the convention for creating a list of checkboxes for Data Admin that my users can select to fill the USER_DATA_ADMIN table?

(kind of new to MVC2)


List Event Receiver in Visual Studio 2010 Received "Save Conflict"


Here is the code. ItemUpdated was looped multiple times that caused the error shown below the code.  I Google the error and one suggestion was adding "if (properties.AfterProperties["vti_sourcecontrolcheckedoutby"] == null && properties.BeforeProperties["vti_sourcecontrolcheckedoutby"] != null)" will prevent the loop. The problem was both properties.AfterProperties["vti_sourcecontrolcheckedoutby"] and properties.BeforeProperties["vti_sourcecontrolcheckedoutby"] were always null. Any ideas?

ListData.svc REST API can't navigate relationship to lookup list in parent site


I have created a list in the root web that contains common information used by multiple sites throughout the site collection.  I have also created a site column that is a lookup column which pulls from that list.  This way, I can add the site column to any list in any sub site in the site collection. 

I have a list in a sub site in the same site collection that I have added the root web site column to and, from the UI perspective, everything works great.  I can add a list item to the sub site list and select an item from the root web list for that column. 

However, if I generate a strongly typed data context and associated classes using a Visual Studio service reference to ListData.svc (or if I just play around with the REST XML in the browser), the class property which represents the lookup column in the sub site list only contains the ID of the lookup item, not a reference to an instance of the item. 

I understand that the experience getting list information from a different site is usually less than optimal but are there any workarounds to get a reference to that lookup list item via the REST API?

Fighting with List Event Receivers


This is what I intend to do:

When a new list item has been added, I want to run some logic and populate some fields programmatically. My first approach was to create a List Item Adding event receiver, however, I cannot "write" to fields via properties.ListItem["field"]. I receive an exception "Object reference not set to an instance of the object".

When I try to implement the same in the "List Item Added" event receiver, it never gets fired.

Any ideas?


Is it possible to update a list item in the ItemUpdating event receiver?


i need to add a property (SPListItem.Properties) to the SPListItem being updated in my ItemUpdating event receiver. is there any way to do that?

SPListItem.Update() doesnt seem to be an option, so the obvious answer is probably trying to use the SPItemEventProperties object called properties by calling properties.AfterProperties.ChangedProperties.Add(key, value) and letting sharepoint do the rest, but it turns out it actually deals with fields and not properties. it's a little misleading. so is there another way? some kind of painful work around maybe?

Disable all day event in Calendar list

Hi there,

Is there anyway of disabling the All day Event field in a Calendar list. I don't have the option to hide it either.

Event Receiver für WorkflowCompleted event - How to get list item?



I'm using an event receiver, which reacts on the WorkflowCompleted event (which is new in SharePoint 2010). In general the event is fired, when an associated workflow has been completed. The question is: how to get the list item the workflow is running against? The WorkflowCompleted event handler has a parameter of type SPWorkflowEventProperties, but via those properties I can't access the specific list item.

Any Idea how to achieve this?




Calendar Web Part for SharePoint that displays and gives fetails of events from an event list: Value

Hi All,

         I have followed the following post to create the custom Calendat webpart, that displays the details of events from events list. 

But i am getting the following error when i click on the dates shown as there are some events. The error looks like the following,

Server Error in '/' Application.

Value does not fall within the expected range. 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.ArgumentException: Value does not fall within the expected range.

Source Error: 

How to delete the default columns( All day Event field ) from the Calendar List in sharepoint?



Is there anyway of disabling the All day Event field in a Calendar list. I don't have the option to hide it either.

Any help appriciated...


Srikanth Reddy

Add Related/Child List Item? - How to automatically set the relationship?




I've got a parent/child relationship between two lists.  I have the parent form set to automatically include child records.

The problem I'm having is that when I "Add new item," it is not associating the new record with the parent record automatically.

How do I have it automatically set the key field?

Thanks in advance for any suggestions,




Item Event Receivers or way to validate data entered for External List in SharePoint 2010?

Hi everyone,

Are there Item Event Receivers for External List in SharePoint 2010? If not, is there a way to validate the item data entered from External List UI in SharePoint site?


ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend