I've added some new fields to my Infopath form using the same configuration as other fields that are already on the form but when I run my process and check the Process Instance Data there is no value for the Data Field that I created. I've setup my Data Event to read the xml field and store it in the data field from the from and i'm not having any luck. I can see the fields just fine in the Object Browser so i know they are not hidden. Am I missing something else? Please help! Thank you, Jamie
Again Verify data event wizard
è Select “Transfer Data”
è Source should be “XML field in Infopath”
è Destinations should be “Data Field”
if it does not work, then you can try below code in server code event
String xml = String.Empty;
XmlDocument doc = null;
try
{
//Get the XML Field string
xml = K2.ProcessInstance.XmlFieldsr"FormName"].Value.ToString();
//Load up the XML
doc = new XmlDocument();
doc.LoadXml(xml);
//Create a name space manager for InfoPath
XmlNamespaceManager nsMgr = new XmlNamespaceManager(doc.NameTable);
nsMgr.AddNamespace("my", doc.DocumentElement.GetNamespaceOfPrefix("my"));
//Assign your data field here
K2.ProcessInstance.DataFieldn"DataField Name"].Value = doc.SelectSingleNode("XPATH OF XML Field", nsMgr).InnerText;
}
catch (Exception exception)
{
throw exception;
}
finally
{
xml = null;
doc = null;
}
I was able to resolve the issue by managing the data connections in the InfoPath Form, I opened the connection and modified the Submit Workflow Service data connection, once I went through all the steps to modify it I saved the form and redeployed my workflow and form and it now saves the newly added fields.
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.