>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.

2 Comments

  1. >Thanks for this Articel. I am currently having the same issue. Unfortunately, I do not fully understand, how you solved the issue. Would you mind clearing that a bit (non-native speaker here..): "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."

    Reply

  2. >Hi well the issue is down to do a mistake in your manifest.xsf file. Are you building your InfoPath forms via Visual Studio?I was and I ended up having to open the manifest.xsf and update the root element which starts xsf:Document Class… the attribute called name was different to the name that I was using for the initiation form. Once they were the same then the workflow initiation form loaded correctly.Does that make more sense?RegardsSimon

    Reply

Thoughts? Comments about this post? Please leave them here..

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.