Hi,
I have create a SmartObject, but when I use it to mapping return data in a XMLField, the event raise:
"Object reference not set to an instance of an object."
It work only if I map return data in a DataField and then copy it via code:
//Get the XML Field string
string xml = K2.ProcessInstance.XmlFieldsd"NOMEFORM"].Value.ToString();
//Load up the XML
XmlDocument 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"));
//Now set some values
doc.SelectSingleNode("//my:ROOT/my:ELEMENTO", nsMgr).InnerText = K2.ProcessInstance.DataFieldsd"NOMEDELDATAFIELD"].Value.ToString();
//Now set the value back into the XML Field
K2.ProcessInstance.XmlFieldsd"NOMEFORM"].Value = doc.OuterXml;