Home > Forum > General > CC tasks assignment to superior of "Any person"

CC tasks assignment to superior of "Any person"
0

Hi,

I have a path where the current user must select another user and pass a form to him. I want to send an email notification to both the selected user and his manager. I’m having trouble determining the manager automatically. Specifically, the problem comes down to the fact that I don’t know how to use a dynamic 'user' variable as a parameter. Or maybe there is another way to determine the manager?

Would be grateful for any tips.

Best regards
Lukasz

Hi Lukasz,
What about this way: create a Business Rule with a parameter.

Create a new Business Rule (e.g., BR_GetManager ).
Add a Parameter (e.g., UserLogin ).
Set the rule type to SQL and use this query:

SELECT COS_ManagerLogin
FROM dbo.CacheOrganizationStructure
WHERE COS_BpsID = '{UserLogin}'

Now you can use this rule anywhere (Email actions, Form fields, etc.) by simply passing your dynamic user variable as the parameter: BR_GetManager({SelectedUse
rField}) .

See also the post:
https://community.webcon.com/posts/post/checking-user-and-group-privileges/258/3

Best regards
Maryna