none
Unexpected "Microsoft.SharePoint.SPListDataValidationException: List data validation failed."

    Question

  • Steps to replicate (I suspect it can be replicated with any list, not just a survey):

    1. Create a survey
    2. Go to Survey Settings / Validation Settings, enter a formula and a user message.
    3. Respond to a survey. 
    3.1. If a formula validation succeeds, a new survey response is created.
    3.2. If a formula validation fails, I expect to see a user message created in step #2 above. Instead, I see an exception:

     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: Microsoft.SharePoint.SPListDataValidationException: List data validation failed.

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Stack Trace:

    [SPListDataValidationException: List data validation failed.]
       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) +25667234
       Microsoft.SharePoint.SPListItem.UpdateInternal(Boolean bSystem, Boolean bPreserveItemVersion, Guid newGuidOnAdd, Boolean bMigration, Boolean bPublish, Boolean bNoVersion, Boolean bCheckOut, Boolean bCheckin, Boolean suppressAfterEvents, String filename) +25664366
       Microsoft.SharePoint.WebControls.SaveButton.OnBubbleEvent(Object source, EventArgs e) +938
       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
    


    Version Information: Microsoft .NET Framework Version:2.0.50727.4927; ASP.NET Version:2.0.50727.4927 

    Server Error in '/' Application.

    List data validation failed.

     

      

    Tuesday, December 29, 2009 2:24 AM

Answers

  • In more recent builds we've eliminated the stack trace, but unfortunately it won't show the message you specified. We're aware of the issue but we're not able to fix it before we ship.
    I make SharePoint Catch me on twitter (@spwiki) or email (kevin.davis@microsoft.com)
    • Marked as answer by vng3333 Wednesday, January 06, 2010 4:27 PM
    Tuesday, January 05, 2010 10:17 PM

All replies

  • In more recent builds we've eliminated the stack trace, but unfortunately it won't show the message you specified. We're aware of the issue but we're not able to fix it before we ship.
    I make SharePoint Catch me on twitter (@spwiki) or email (kevin.davis@microsoft.com)
    • Marked as answer by vng3333 Wednesday, January 06, 2010 4:27 PM
    Tuesday, January 05, 2010 10:17 PM
  • Thank you.
    Wednesday, January 06, 2010 4:27 PM
  • Hi Kevin,

    Even I'm facing the same error.I have written a basic formula for validating a field in document set.Would you please let me know wether there is any hotfix for this error.




    Thanks in Advance,

    Indusekhar.
    Tuesday, January 26, 2010 10:21 AM
  • We need to ship before we can consider hotfixes ;-)

    At this time, there isn't a plan to ship a hotfix for this issue.
    I make SharePoint Catch me on twitter (@spwiki) or email (kevin.davis@microsoft.com)
    Tuesday, January 26, 2010 7:27 PM
  • Thanks a lot for the update Kevin.
    Wednesday, January 27, 2010 5:56 AM
  • Hey kevin,

    any updates yet on this matter, i'm kinda stuck here and my QC won't let that go :P


    Hazem Elshabini OMS (Online Modern Solutions) Software Developer http://infopointblog.com
    Monday, July 26, 2010 2:08 PM
  • Kevin, has there been a fix for this released yet?
    Tuesday, December 07, 2010 5:16 PM
  • Anyone managed to resolve this? ListDataValidation when uploading a document shows the error with a stack trace when the web.config has its customerros mode off.

    The same validation works perfectly in an edit form.

    let me know.....


    Karthick
    Sunday, January 30, 2011 6:43 PM
  • Is there an update on this issue?

    We have this problem on a production system and the client's QA will not let it pass until this is sorted.

     

    Monday, April 18, 2011 1:45 PM
  • No, I think I even tried updating to SP 2010 Service Pack 1, with no success. This is a pretty ugly bug and we have to find an alternative way to address this.

    http://www.sharepointboost.com/formvalidation.html - I ultimately ended up using this.


    Karthick
    Monday, April 18, 2011 1:54 PM
  • Does anyone know if there is a hotfix for this issue yet? I would expect more than a year later there would be one, but if so I can't seem to find it. I would really like to correct this issue as column validation is a nice enhancement over SharePoint 2007. Thanks in advance for any help,
    • Proposed as answer by Ajit.Jha Friday, May 27, 2011 11:24 AM
    • Unproposed as answer by Ajit.Jha Friday, May 27, 2011 11:24 AM
    Saturday, May 21, 2011 8:24 PM
  • Validation can be possible using including javascript code in EditForm.aspx(NewForm.aspx).
    Solution:
    In this example i am going to valid a field named MDate which should only accept monday from datepicker field.
    1. Please open EditFrom or NewForm.aspx in SharePoint Designer.
    2. Add a content editor in the page below in the design mode.
    3. Go to Code window Find content Editor webpart.
    4. Find Content tag with blank div.
    5. Insert the following javascript in the div.
    <script type="text/javascript">
      
    function PreSaveAction() 
        var date1 = getTagFromIdentifierAndTitle("INPUT","DateTimeFieldDate","MDate");   
        var arrDate1 = date1.value.split("/"); 
        if(arrDate1 == "")
        {
         return false;
        }
        var useDate1 = new Date(arrDate1[2], arrDate1[0]-1, parseInt(arrDate1[1])); 
        if(useDate1.getDay()==1)
        {
         return true;
        }
        return false;  // OK to proceed with the save item 
    }
    function getTagFromIdentifierAndTitle(tagName, identifier, title) {
    var len = identifier.length;
    var tags = document.getElementsByTagName(tagName);
    for (var i=0; i < tags.length; i++) {
    var tempString = tags[i].id;
    if (tags[i].title == title && (identifier == "" || tempString.indexOf(identifier) == tempString.length - len)) {
    return tags[i];
    }
    }
    return null;
    }
    </script>
    6. Save the page and try to add or edit any list item.
    for further reference please go to 
    http://edinkapic.blogspot.com/2007/10/add-javascript-date-validation-into.html
    http://edinkapic.blogspot.com/2007/08/hide-field-from-newformaspx.


    Friday, May 27, 2011 11:33 AM
  • Validation can be possible using including javascript code in EditForm.aspx(NewForm.aspx).
    Solution:
    In this example i am going to valid a field named MDate which should only accept monday from datepicker field.
    1. Please open EditFrom or NewForm.aspx in SharePoint Designer.
    2. Add a content editor in the page below in the design mode.
    3. Go to Code window Find content Editor webpart.
    4. Find Content tag with blank div.
    5. Insert the following javascript in the div.
    <script type="text/javascript">
      
    function PreSaveAction() 
        var date1 = getTagFromIdentifierAndTitle("INPUT","DateTimeFieldDate","MDate");   
        var arrDate1 = date1.value.split("/"); 
        if(arrDate1 == "")
        {
         return false;
        }
        var useDate1 = new Date(arrDate1[2], arrDate1[0]-1, parseInt(arrDate1[1])); 
        if(useDate1.getDay()==1)
        {
         return true;
        }
        return false;  // OK to proceed with the save item 
    }
    function getTagFromIdentifierAndTitle(tagName, identifier, title) {
    var len = identifier.length;
    var tags = document.getElementsByTagName(tagName);
    for (var i=0; i < tags.length; i++) {
    var tempString = tags[i].id;
    if (tags[i].title == title && (identifier == "" || tempString.indexOf(identifier) == tempString.length - len)) {
    return tags[i];
    }
    }
    return null;
    }
    </script>
    6. Save the page and try to add or edit any list item.
    for further reference please go to 
    http://edinkapic.blogspot.com/2007/10/add-javascript-date-validation-into.html
    http://edinkapic.blogspot.com/2007/08/hide-field-from-newformaspx.
    Friday, May 27, 2011 11:35 AM
  • We are thankful to Ajit of Aditi, but that is "another way" or a work-around. The built-in SharePoint Column Validation and List level validation problem still seems to be unresolved- I thought this can be considered important enough to draw some attention from Microsoft, but apparently not so! Anyone having solved this problem (not with javascript/jquery/C#), please share. I am doing a lot of coding, but wanted to know if this built-in validation is working now!
    MSAPXPert
    Saturday, November 05, 2011 8:56 AM
  • I agree with you MSAPXPert. It's disgracefull to not have a resolution for this yet. I figured sp1 would have the fix but it doesn't seem to address the flaw either.

    Ajit.Jha, one issue I have with your workaround is the column names on the survey are the full question of the survey. Also they are not likely to be dates but radio button or checkboxes (at least in my case).

    I'm hoping we see some movement on this issue soon considering the length of time this bug has been in the product.
    Monday, November 07, 2011 6:53 PM
  • Still waiting... we need this to be fixed too. We are using Sharepoint Server 2010. This is fundamental functionality in validating a survey.

    Wednesday, March 14, 2012 9:23 PM
  • Hi Kevin,

    Did you find any way to resolve this issue. Please update me we are still facing this issue and very urgent to resolve this.

    Thanks in advance.

    By

    Nani

    Tuesday, June 12, 2012 9:29 AM
  • It seems there is finally a hotfix available for this issue: http://support.microsoft.com/kb/2687339

    This hotfix is included in the August 2012 CU for SharePoint 2010.

    I have not tested the hotfix yet.


    Wednesday, September 12, 2012 1:51 PM
  • Harro, I tried the hotfix but it did not work.

    Wednesday, November 07, 2012 2:15 PM
  • Look for -- <xsl:template name="dvt_1"> in your edit/new form using designer.

    Place <sharepoint:itemvalidationfailedmessage id="checkform" ControlMode="New" runat="server">

    ..right underneath<Sharepoint:ItemHiddenVersion>

    ControlMode depends on what type of form you are working on. (New/Edit)

    GooLuck



    Wednesday, April 09, 2014 2:34 PM