Skip to main content











Normal
0




false
false
false

EN-US
X-NONE
X-NONE













MicrosoftInternetExplorer4






























































































































































I am hoping someone can help me with some syntax here:


 


I have a code event, wherein I write some data to a process
data field using code something like:


 


K2.ProcessInstance.DataFieldsd“FieldName1”].Value = true;


 


Later on in the code, I want to pull data from another
process data field.  I had assumed I might be able to similarly use
something like:


 


Variable =
K2.ProcessInstance.DataFieldsa“FieldName2”].Value;


 




But
this does not seem to work as I get the build-time error that my variable is of
type Boolean and I’m referring to a thing of type Object.  What is the
proper syntax for reading a process data field?



Thanks!

The datafield value is type Object.  You need to cast it to the proper type.  For example:


bool somefield = (bool) K2.ProcessInstance.DataFieldsd"FieldName1"].Value;


 


Reply