Wednesday, September 10, 2008

WF Error with Separate Association and Initiation Forms

Error

I came across another interesting error to today when building some workflows in Visual Studio for SharePoint.

Critical The form template failed to load. (User: SHAREPOINT\administrator, Form Name: InitiationForm, IP: , Request: http://mossserver:28921/_layouts/IniWrkflIP.aspx?List=0ffc0061-eb35-4533-80e8-2b488c4c8371&ID=1&TemplateID={611ca686-af64-497e-b3c4-debbb8421a56}&Source=http://mossserver:28921/createuer/Lists/aaa/AllItems.aspx, Form ID: urn:schemas-microsoft-com:office:infopath:InitiationForm:-myXSD-2008-09-09T17-43-22, Type: SchemaValidationException, Exception Message: Could not find schema information for the element 'http://schemas.microsoft.com/office/infopath/2003/myXSD/2008-09-09T15:06:55:myFields'.) 2b07a15f-6e26-440f-9ed2-351042351288

I did some searching and came up with this link which gave me a lead - http://social.msdn.microsoft.com/forums/en-US/sharepointworkflow/thread/83264f93-ebe3-49ec-bd6b-95ee02df4d8a/

Resolution

Well after re-reading my recommended book by Scot Hillier I noticed he had an obscure step where he took the Association InfoPath form he had created and then created the Initiation Form from it. Why he did that; well he did not explain other than saying the forms needed to be the same. Once I did this problem resolved. I then stumbled across this in my other readings which basically says the schemas of both of the forms must be the same.

I tried to do some more searching on why this is the case but I could not find anything. Really this dependency makes no sense what so ever. I really look at the association form as the form that is used to capture information related to the association of the workflow to the list while the initiation form would capture information that is only related to the workflow instance that is about to be created. An example would be that the association form must take a configuration to a database, web service address, or even a designed guid to another list that will be used by the workflow. While the Initiation form would capture such information as the manager's name that must approve. Right now, I have to combine all this into a single form.

No comments: