Can anyone please offer some advice on accessing datafields from within a workflow? I have a an XML field showing in the object browser as 'firstname', which is populated from an InfoPath form. Once the workflow has been approved I want to take this name along with some other information and use it to create a user account. To do this I have added a Default Server Event (Code) activity and gone to View Code -> Destination Rule. Then under the ExecuteCode method I am trying to read from the firstname field with:
user = K2.ProcessInstance.DataFields["firstname"].Value.ToString();
But this gives the following exception:
28006 Datafield firstname not found
I have tried using ActivityInstance instead and get the same exception. Am I going about this completely wrong, and are XML datafields accessed in a different manner?
Thanks.