I am working in SharePoint 2010.I am dynamically creating a list on FeatureActivation event. My list has following columns Title : Text , VisibleTo: User/People, Menu : Choice, Type : Choice.

Problem is when I try to add items dynamically it gives me following error.

Invalid data has been used to update the list item. The field you are trying to update may be read only.

As the error message suggest, there is no read only field in the list.

Please help me on finding the exact cause of this error.

oList.Fields.Add("LinkTitle", SPFieldType.Text, true);                     
oList.Fields.Add("URL", SPFieldType.Text, false);
oList.Fields.Add("ShowInNav", SPFieldType.Boolean, false);
oList.Fields.Add("VisibleTo", SPFieldType.User, false);
oList.Fields.Add("ParentID", SPFieldType.Text, false);

oListItem["Title"] = newListItem.Title;
oListItem["LinkTitle"] = newListItem.LinkTitle;
oListItem["URL"] = newListItem.URL;
oListItem["ShowInNav"] = newListItem.ShowInNav;
oListItem["VisibleTo"] = oWeb.EnsureUser("ABC");
oListItem["ParentID"] = newListItem.ParentId;

Where newListItem is a collection of items.

Many thanks



1 Answer 1


As Steve comments it's hard to guess without any code. But my guess would be that the Person(s) inserted into VisibleTo isn't on the site. Try using EnsureUser before adding them.

OK after the code has been added it's a bit easier.

Remove the following lines :

oList.Fields.Add("LinkTitle", SPFieldType.Text, true); 


oListItem["LinkTitle"] = newListItem.LinkTitle;

LinkTitle and LinkTitleNoMenu are two very special fields which has the same data as Title (and therefore shouldn't be updated), but different representation in views.

  • Hi Per I tried that but still I have the same error.Though user is present on site.
    – V.B
    Jun 13, 2012 at 7:57
  • Thanks per. It worked after removing the Link Title column.
    – V.B
    Jun 13, 2012 at 8:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.