Submit to SharePoint List "Invalid date/time value" Web Form Error and Workaround: qRules 4.1, InfoPath 2010, and SharePoint 2010 - InfoPath Dev
in

InfoPath Dev

Submit to SharePoint List "Invalid date/time value" Web Form Error and Workaround: qRules 4.1, InfoPath 2010, and SharePoint 2010

Last post 10-03-2012 12:56 PM by DC Forms. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 09-11-2012 06:37 AM

    • DC Forms
    • Top 150 Contributor
      Male
    • Joined on 06-14-2012
    • Washington, DC
    • Posts 76

    Submit to SharePoint List "Invalid date/time value" Web Form Error and Workaround: qRules 4.1, InfoPath 2010, and SharePoint 2010

    I have a form in development that worked fine when previewed in the InfoPath client using qRules Submit to SharePoint List (SubmitToSharePointList) command. But when the form was rendered in the browser the following error would occur:

    Errors occurred submitting to list: Invalid date/time value.  A date/time field contains invalid data. Please check the value and try again.

    I tracked the error down to a particular date field. The field in question had some rules applied that performed a query on a secondary data connection in order to populate another form field with a value based on the date entered. While watching the web form operate I noticed that for a brief moment as the rules were executed the format of the date displayed changed from the default M/D/YYYY to YYYY-MM-DD as the "Sending data to server..." message appeared, and then the format changed back to M/D/YYYY once the rules executed.

    The quick workaround I implemented was to create a date helper field that is displayed on the form with rules applied. I added an addition rule that runs first that runs when the helper field value changes and sets the actual date field to the same value. Since the rule runs first it populates the field submitted to SharePoint in the proper format before the web rendering engine does its funky reformatting.

  • 09-13-2012 08:31 AM In reply to

    Re: Submit to SharePoint List "Invalid date/time value" Web Form Error and Workaround: qRules 4.1, InfoPath 2010, and SharePoint 2010

    Thanks for posting your workaround. Just as a note - the displayed value on your form may not be the actual value of the field - I usually check the XML in a text editor if I am unsure of a field's actual value.

    Hilary Stoupa

  • 10-02-2012 09:59 AM In reply to

    • DC Forms
    • Top 150 Contributor
      Male
    • Joined on 06-14-2012
    • Washington, DC
    • Posts 76

    Re: Submit to SharePoint List "Invalid date/time value" Web Form Error and Workaround: qRules 4.1, InfoPath 2010, and SharePoint 2010

    Update:

    The error is now occuring with a different form that was working, but now isn't. Strange. The second form only has simple validation rules applied to the date fields (is blank).

    The form works fine in preview, it errors out when rendered in the browser.

    The form exceeds the attachment size limit. I can e-mail it in, if needed.

  • 10-03-2012 12:56 PM In reply to

    • DC Forms
    • Top 150 Contributor
      Male
    • Joined on 06-14-2012
    • Washington, DC
    • Posts 76

    Re: Submit to SharePoint List "Invalid date/time value" Web Form Error and Workaround: qRules 4.1, InfoPath 2010, and SharePoint 2010

    The data type in the main data data source was set/changed to text while the form control was set as the date picker.

    Ernesto tracked the problem down. I expect the improper data type was my mistake, but puzzled why it sometimes works and other times doesn't. I suspect sometimes the data picker populates a text field with a date that matches what the SharePoint list expects and sometimes it doesn't. And/or SharePoint is sometimes quirky.

Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.