Unknown's avatar

Posts by Simon Doy

I am an avid SharePoint enthusiast who works as an Independent SharePoint Consultant based in Leeds, United Kingdom. I am one of the organisers of the Yorkshire SharePoint User Group in the United Kingdom. I have been designing and building SharePoint solutions since 2006.

>InfoPath Initialisation Form DatePicker and TextBox not working


>Recently I have been working more with InfoPath forms for Initialisation and Association data into SharePoint workflows. These forms allow you to define how you would like the workflow to work for example setup default text which is sent with the workflow when a user is asked to do something.

One little issue that I had which took some time to diagnose was the following:-
So I have a date picker which is used in an Initialisation form to let the user set a date when they would like a response by. Great however when you tried to use the date picker control is didnt work.

Even if I added other controls with their new xml elements those controls did not work.

After trying umpteen options I discovered that it was all to do with the AssociationData which is sent as part of the workflow feature, see workflow.xml element.

Using the sampledata.xml I copied over the missing xml element AssignTaskDueDate into the workflow.xml AssociationData section. After deleting the workflow within SharePoint and recreating then the DatePicker control stopped being disabled.

If you have any questions on this just drop a comment.

>SharePoint Workflow InfoPath Forms: SchemaValidationException, Exception Message: Schema validation found non-datatype errors.


>Whenever I start developing SharePoint workflows there are always a couple of gotchas that get me. Unfortunately or should that be fortunately it is generally different things each time.

The current workflow that I am developing for a client is using Association and Initialisation Forms. Getting the association form to work took a couple of attempts, the major one being that each time I updated the solution, the forms themselves were not being updated which kinda didnt help as I was trying allsorts of things to solve it. Once the solution was deleted and readded in then the form started work.

“Great I thought” and then I actually tried to start a workflow and the dreaded Form has closed message quickly appeared.

Fortunately on a quick investigation of the ULS logs (c:\program files\common files\microsoft shared\web server extensions\12\logs) there was an entry from the Form Server Runtime. Which stated that the form could not be open successfully due to the following:-

SchemaValidationException, Exception Message: Schema validation found
non-datatype errors.

Looking around on the web there wasn’t too much however I did find a post by Scot Hillier on creating a workflow with such forms. This pointed me to something that I wasn’t do and this is using Association Data. When you create an InfoPath project then a sampledata.xml file is created which gives a – yes you guessed it – a xml file with the sample default data from your form.

Using this I created an entry within workflow.xml called AssociationData. Using the sampledata.xml copy over the xml in between the AssociationData tags.

Redeploying the solution refreshed the InfoPath forms but the Initialisation form still failed to load.

Looking at the form schemas I realised that maybe it was due to the difference in the forms schemas. I updated each of the elements, each time there was no difference until finally I updated the root element schema name so that they are the same.

This solved the problem, on top of that it meant that I now only needed one serialization class to read the forms xml data! If you don’t know what I am talking about then please take a look at this MSDN post.

Happy coding.