I'm trying to initialize a task form (in my workflow) with values contained in my infopath form (the global one if I could call it like this ^^).
For example, I've a worflow which is activated on a command from a client. The first task is assigned to the client, he has to fill in a form with some values (command name, adress, ...). Next, I save those values to my "global" infopath form. It works. After that, I create a task for the command manager who get a summary of the command and he has to validate it or not. In this form, I want to retrieve values from the global form. This is the problem.
I tried to use a data connection on the global infopath form and set the default value of the field in the task form. For example, the command name : @CommandName. And it doesn't retrieve any value...
I don't know if you need more information and if you guys understand my question cause it can be a bit confused. So don't hesitate to ask me question to clarify.
This issue is solved now.
My workaround : Define a Content Type for each fields. Add extended properties to the task with the name of your field :
myTaskProperties.ExtendedProperties["myFieldName"] = "my expected value";
This is the way to pre-fill your form by the code.
To retrieve data from your global infopath form : I've a method which do that. This method is going to read the xml (my global infopath) and get the value. After that, I add this value instead of "my expected value" above.
If you want more explanation or code, don't hesitate to contact me.