I have a project that uses a Smart Object to create a PDF through Adlib, but I need it to go from one Activity into another Create PDF activity. The first creates a PDF of one of the Infopath views then I need to change the views in the second create PDF. The problem is that anything I do to change the Print View returned to Adlib will not wok since the Infopath form is not getting opened between activities. I tried to do the following in a Server Code Event, but it errors anyone come across a solution to this before?
//Get the XML Field string
string xml = (string)K2.ProcessInstance.DataFields["UpdatedXML"].Value;
//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:Form0419/my:PrintSelect", nsMgr).InnerText = "Print View 2";
//Now set the value back into the XML Field
K2.ProcessInstance.XmlFields["XXX"].Value = doc.OuterXml;