Populate grid with constraints

0
Hi I have two entities ‘Tasks’ and ‘UserData’ . Tasks entity has Employee Name and task attributes. UserData entity has Role attribute which has values Engineer, TeamLead, so on. My requirement is, I need to populate a grid with tasks of employees who are reporting to a Team Lead. For an instance, If a Team Lead Signs the grid should display only data of the employees who are reporting to them. I want achieve this without creating separate user role for team lead.
asked
1 answers
0

Hello,

From your entites I’m not getting exact associations but depending on my understanding I’m giving answer considering below associations.

Entities(UserData,Task)
Associations
1)UserData_TeamLead(*...1 many user can have 1 team lead)
2)UserData_Task(1...* 1 user can have many tasks)

A)Now you want to retrieve Task objs of employees who are reporting to all Team lead(for all users except team lead) and 
retrieve Task objs of employees who are reporting to logged Team lead(if team lead logged in)
-for datagrid select datasource as microflow
-in that microflow first retrive current logged in user

-check logged in user, if logged in user not team lead then 
-----retrieve task objs from database with xpath Task_UserData/UserData/UserData_TeamLead!=empty
-----and return that retrieved taskList
-if logged in user team lead then
-----retrieve task objs from database with xpath Task_UserData/UserData/UserData_TeamLead!=$CurrentUser
-----and  return that retrieved taskList

Kindly adjust logic as required.
Hope this helps you.

Thank you.

answered