Accessing Environment fields from server code
+9
Should be a no-brainer, but how do we get to Environment fields from server code? Process fields are easy: K2.ProcessInstance.DataFields, but I don't see an intuitive way to get to Environment fields - is there one?
+11
The environment library is a design-time construct. At run time the values can be found in the string table. Take a look at this link and see if this helps:
+9
Thanks for the response, but what the technique described be similar to simply grabbing 'K2.StringTable' in a server code event?
+9
After a few quick tests, I can answer my own question here: Yes, K2.StringTable goes against the fields you define in the Environment section of the K2 Object Browser. Even though the parameter asks for an 'Index', you actually specify the name of the field you want to grab. So if you define a miscellaneous field in your environment named 'Test', to get its value you'd use this code:
K2.StringTable[
"Test"]Reply
Enter your username or e-mail address. We'll send you an e-mail with instructions to reset your password.