Skip to main content

As per the title of this post, is this possible?


K2.ActivityDestinationInstance.XmlFields["MYINFOPATHFORM"] seems to get me a copy of my form for the activity destination instance, but it's blank!


is it possible for me to get to the instance of the form that the destination user will open. I want to be able to add some content to the form for a specific destination.


Martin


 


Edit: should be K2.ActivityInstanceDestination.XmlFields

Hi Martin.


I don't believe the XML field in the ActInstDest is updated until the InfoPath Client Event actually executes.  Thus you'll need to dip into the code level of the InfoPath client event wizard.  If you right click on the InfoPath client event, you should see an option to 'View Code", then select "Event Item".  You should then be presented with the WF xoml.  I'd suggest looking in "uploadTempInfoPath" (double clicking on it will take you to the code for the method in the C# code behind). 


Once here you should see where the process xml field  (i.e. the original InfoPath submission) is being uploaded to SharePoint.  You should be able to change the data in the XML field here.


You mention that you are interested in doing this for a specific destination.  If you are using the default "Plan just once" destination, then this will not have any user context.  I think you will need to change the Destination to "Plan per Destination - all at once" in the Activity Destination Rule - Advanced options in order for you to have user context at this level (which you should then be able to recover with code like:


   string strDestUser = K2.ActivityInstanceDestination.User.FQN;


HTH.


Bob


Wow Bob,


thanks very much for a complete and expert reply to my question! This is exactly what I needed to solve my problem.


many thanks again


Martin


Reply