0

I have a simple list with a non required lookup column. If I try to create a new entry in the list with the lookup column left as "none", I receive the error:

The list item could not be inserted or updated because invalid lookup values were found for the following field(s) in the list: [field]

A couple of notes:

  • The lookup is on a calculated column.
  • There is no error if the new row is created in datasheet view
  • There is no error if a lookup value is selected

Here is the stack trace:

[SPInvalidLookupValuesException: The list item could not be inserted or updated because invalid lookup values were found for the following field(s) in the list: [field].] Microsoft.SharePoint.SPListItem.AddOrUpdateItem(Boolean bAdd, Boolean bSystem, Boolean bPreserveItemVersion, Boolean bNoVersion, Boolean bMigration, Boolean bPublish, Boolean bCheckOut, Boolean bCheckin, Guid newGuidOnAdd, Int32& ulID, Object& objAttachmentNames, Object& objAttachmentContents, Boolean suppressAfterEvents, String filename, Boolean bPreserveItemUIVersion) +26873704 Microsoft.SharePoint.SPListItem.UpdateInternal(Boolean bSystem, Boolean bPreserveItemVersion, Guid newGuidOnAdd, Boolean bMigration, Boolean bPublish, Boolean bNoVersion, Boolean bCheckOut, Boolean bCheckin, Boolean suppressAfterEvents, String filename, Boolean bPreserveItemUIVersion) +26873182 Microsoft.SharePoint.SPListItem.Update() +166 Microsoft.SharePoint.WebControls.SaveButton.SaveItem(SPContext itemContext, Boolean uploadMode, String checkInComment) +20394338 Microsoft.SharePoint.WebControls.SaveButton.OnBubbleEvent(Object source, EventArgs e) +1325 System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +70 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +29 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2981

Any thoughts?

  • What data type is your calculated column supposed to return? – clk Aug 12 '15 at 22:11
  • It returns a 'single line of text' – Matt Aug 13 '15 at 12:35
1

If you're using SharePoint Foundation 2010, then this is a known issue where a custom list has a lookup field to another custom list that contains more than 20 items. If you set the value of the lookup field to "None," then you'll get the error. It looks like you'll need to apply an update to SharePoint to resolve the error. Here's more info:

  1. https://support.microsoft.com/en-us/kb/2687375
  2. https://social.msdn.microsoft.com/Forums/office/en-US/187bba01-98ee-4672-ba17-342309463c7a/list-item-could-not-be-updated-because-invalid-lookup-values-were-found-for-one-or-more-fields-in?forum=sharepointdevelopmentprevious
  3. https://social.technet.microsoft.com/forums/sharepoint/en-US/fc14a846-403c-4abb-85c6-af27a1dee159/nonrequired-lookup-column-throws-error-if-none-or-blank

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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