I have a process with three events. The first event is the initial event that starts the process, the second event must be approved by the originator's manager (no problem there), the third event must be approved by the originator's manager's manager. How do I get this user to be the destination user of the third event?
You have to take into consideration the user might not have a manager's manager.
------------------ something like this Dim oDSH As New SourceCode.K2Utilities.DSHelper()
Dim oDEManager As System.DirectoryServices.DirectoryEntry
oDEManager = oDSH.GetManager(k2.ProcessInstance.Originator.FQN)
sManagerFQN = oDSH.GetNetBiosNameFromDNS(oDEManager.Properties("distinguishedName")(0).ToString) & oDEManager.Properties("samAccountName")(0).ToString
oSecondLevelManager = oDSH.GetManager(sManagerFQN)
That is what I was looking for.
Thank you
The codeless way would be to create a SmartObject to pull the manager of a specified user name. I think this article done by Joseph (http://k2underground.com/forums/post/18783.aspx) is somewhat similar except for the fact that you need to map the manager property of the user (instead of ManagedUsers) to your SmartObject field. Once you have this SmartObject, you can use it in your destination rule to pull the next user from the originator's manager. It's pretty easy to get this working in a couple of minutes.
Arr yes, that is a current limitation.
This can probably be easily fixed by stripping out the user name using a few lines in server event or populated as a data field from the submission page depending on which way is easier. I would think that taking the Web Page Identity and putting it into the Process data field would be the easiest way of doing it.
I'll log an enhancement request to improve the AD service broker to take in different user name formats.
Reply
Enter your username or e-mail address. We'll send you an e-mail with instructions to reset your password.