how to set Destination Rule from K2 data field

  • 10 January 2006
  • 1 reply
  • 2 views

Badge +3
i want my destination rule (send to manager) to get the value from a form that started my process. in the form, there will be a value from a textbox there that will contain a domain/username which will be stored to my K2 data field called UserName.

in k2 studio, i generate code for my destination rule. here's the generated code

oDEManager = oDSH.GetManager(oDSH.GetUser("domainusername").Path)



how do i edit this code to dynamically get the value of my UserName data field which was filled up from the form? i tried

oDEManager = oDSH.GetManager(oDSH.GetUser(K2.ProcessInstace.DataFields("UserName").ToString).Path)


but i get an error saying object not reference not set to an instance of the object. please help.

thanks

1 reply

Badge +11
I may be wrong here but just try:
K2.ProcessInstace.DataFields("UserName").Value

Regards,
Ockert

Reply