Wednesday, August 13, 2008

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

If you get that error when opening an infopath form after programmatically editing the form, you need to set the PreserveWhitespace property to true:

XmlDocument myDoc = new XmlDocument();
myDoc.PreserveWhitespace = true;
myDoc.Load(myInStream);

helpful post on updating infopath form programmatically

http://www.novolocus.com/2006/08/15/update-infopath-forms-from-within-workflow/

Tuesday, August 12, 2008

TaskProperties Null in CreateTask activitiy

In a statemachine workflow I was building recently, I made the mistake of assigning my TaskProperties in a CreateTask activity to a new Property instead of a new Field (Bind to a new Member tab). Fields get initialized as SPWorkflowProperties objects with all the properties such as Title and AssignedTo instantiated and ready for you to assign values to them in your invoked event. This is not the case with Properties, the Title and AssignedTo sub props won't be accessible because the prop isn't setup as a strongly typed SPWorkflowProperties object yet. Instead, you get "Object reference not set to an instance of an object" when you try to access title or any other sub props. There you go.

Thursday, August 7, 2008

Infopath development with Visual Studio 2008 Issues

Anyone else out there having build and publish weirdness with Visual Studio 2008 VSTO? I can't build my form when the manifest.xsf file is open, yet when it's closed, I can't publish it because the Publish option only appears in the build menu when you have a form open. Anyone know what's up there?

Unhandled exception when rendering form System.Xml.XmlException: 'something' is an unexpected token. The expected token is '<>'.

if you see something like this in your logs when developing an InfoPath form that is browser enabled in Sharepoint:

Unhandled exception when rendering form System.Xml.XmlException: 'Number' is an unexpected token. The expected token is '='. Line 247, position 673. at System.Xml.XmlTextReaderImpl.Throw(Exception e) at System.Xml.XmlTextReaderImpl.Throw(String res, String[] args) at System.Xml.XmlTextReaderImpl.ThrowUnexpectedToken(String expectedToken1, String expectedToken2)


... then you have a problem with one of your secondary data connections that is or was bound to a field on your form. delete one by one until you find the culprit, and troubleshoot from there.

statemachine workflow and correlation tokens

does your first task create just fine, then the second one gives you problems? do you see an error in visual studio when you attach the debugger? you're probably doing what i was doing and assigning correlation tokens for each task to the workflow as the OwnerActivityName. that's what all the examples tell you to do right? well, all the examples also only have one state in which tasks are being created. correlation tokens need to be assigned to the STATE OwnerActivityName! i learned this here: http://blog.goedvriend.com/?p=49