Skip to main content
How do I get the datafield values from the current running process when on a form.

Say for example, on the form I wanted to write the Datafield "name" value to a database as part of the functionality, how do i get that Datafield's value at runtime from a form (Not the K2 Server code)

Many thanks

Rob
Hi Rob,

The only way that you can get to the data fields 'programmatically' (without pulling the values DIRECTLY from the K2Log DB) (which you may or may not wish to do), is to use the 'WorklistItem' object in the K2ROM.

The Worklist Item object, contains a handle to the 'ProcessInstance' and 'ActivityInstance' objects, and each of these contain the relevant data fields.

Note that you can only get to the WorklistItem, on the form that is sent to the appropriate user (as a client event), and it needs a Serial Number. You cannot, therefore, create a 'WorklistItem' object on an adhoc page, because it doesn't have the correct context.

Does this make sense?

Cheers
Olaf
Many thanks,

Cheers

Reply