Getting Action Result Value in Blackpearl

  • 1 October 2008
  • 1 reply
  • 0 views

Badge +1

Hi,


I am trying to retrieve the Value from the "Action Result" and assign it to a field in my Infopath.


I have tried the follwoing:


string

xml = K2.ProcessInstance.XmlFields[0].Value.ToString();


XmlDocument doc = new XmlDocument();


doc.LoadXml(xml);


XmlNamespaceManager nsMgr = new XmlNamespaceManager(doc.NameTable);


nsMgr.AddNamespace(

"my", doc.DocumentElement.GetNamespaceOfPrefix("my"));


doc.SelectSingleNode(

"//my:AntragSG6/my:ApplicationStatus/my:Status", nsMgr).InnerText = "Approved";


K2.ProcessInstance.XmlFields[0].Value = doc.OuterXml;


This works well if I put this in a Default Server Event before my Infopath Event, But after the Infopath Event I can not set the Value ( in the same Activity).


What can be the Problem. Is the Infopath Field not accessible anymore?


Basically I need to store the Action an Approver has taken and store it in the Infopath Field to display it as the Status on the Library. May be I am trying it the wrong way. Any Ideas?


Thanks in Advance


 


1 reply

Badge +11

Whenever you want to use a server code event to manipulate InfoPath XML, it is easier to do it in a separate activity from the InfoPath client event.  The reason has to do with activity planning and slots for destination rules.  


 

Reply