Skip to main content
I have browsed through the knowledge base and the forums regarding methods of capturing the originator of a process. The method of choice is to create a data field and update this field with the information.

My question is, how is this done?

I have tried methods I have used successfully to update other data fields, but can not get this one to work.

Thanks,

JR
All you should need to do is:

- Create a process datafield called "Originator".
- Within a Server Event, put the following line of code:

K2.ProcessInstance.DataFields["Originator"].Value = K2.ProcessInstance.Originator.FQN;


Please note the Originator is a K2ROM User object. FQN (Fully Qualified Name) is one of the properties. You may be interested in checking out if others are more approrpiate for you.
Please bear with me, I am not a code writer, but was assigned this task.

My server event has the following code:

Sub Main(ByVal K2 As ServerEventContext)
K2.Synchronous = True
K2.ProcessInstance.DataFields["Originator"].Value = K2.ProcessInstance.Originator.FQN
End Sub

I get the following errors when I compile the solution:

Line 3: Property access must assign to the property or use its value.
Line 3: Identifier expected

Thank you,

JR
I believe proper VB.NET syntax should be (note the "(" instead of the "[", which is C#):

K2.ProcessInstance.DataFields("Originator").Value = K2.ProcessInstance.Originator.FQN

Sorry for any confusion.

I hope this helps.
Bob,

Thank you, that fixes the problem.

JR

Reply