Announcement

Collapse
No announcement yet.

[Advanced pack - Reports] Report showing items based on teams

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • [Advanced pack - Reports] Report showing items based on teams

    Hello all,

    I have purchased the Advanced pack and am using the report section sucessfully.
    However, I am trying to achieve something quite simple : Create a "My team opportunities" and "My team activity" dashboards.

    As it's required my user need to access to all activities and opportunity in read only on the lists, on their role, the scope has been set to Read = "all'.

    I created a report showing the opportunities with the filter opporunity.AssignedUserID = env\userAttribute('id') for the people to see their own opportunities and did the same with activity. It works well.

    When I try to achieve the same with teams, it's not possible for the following reasons :
    - You can add a filter on Teams, but then you can only add hard coded values in the filter and it seem not possible to put a formula there retrieve the teams the user belong via env\userAttribute('team') (probably because of the N-N relation)
    - When I choose complex expression, Teams is not in the dropdown list of the possible filters anymore so I cannot use formula to retreive my current user teams.

    Is it possible to create a report based on the items linked to the teams the current user belongs to ?

    Otherwise, could you please help me try to figure out where the "My activity" factory widget is defined so I can try to recreate it and adapt it to a team level ?

    Best Regards,
    Chris

  • #2
    Hello,
    There is no such an ability. Even if you will set the permission to read -> team, an assigned user will always have access to the assigned records, even if the team is not matched.
    For the My Activities dashlet please investigate this file ./application/Espo/Modules/Crm/Resources/metadata/dashlets/Activities.json.

    Comment


    • #3
      Hi Chris,

      As a workaround you can create multiple reports (using duplicate action) that will differ in their teams in the filter. Each report will have their specific team. Then make these reports available only for users of specific teams (with roles on report scope).
      Last edited by yuri; 01-15-2020, 08:50 AM.

      Comment


      • #4
        Originally posted by Maximus View Post
        Hello,
        There is no such an ability. Even if you will set the permission to read -> team, an assigned user will always have access to the assigned records, even if the team is not matched.
        For the My Activities dashlet please investigate this file ./application/Espo/Modules/Crm/Resources/metadata/dashlets/Activities.json.
        Thanks for the tip I'll investigate the dashlet to check the logic there to see if I can duplicate the dashlet and change the filters.

        Originally posted by yurikuzn View Post
        Hi Chris,

        As a workaround you can create multiple reports (using duplicate action) that will differ in their teams in the filter. Each report will have their specific team. Then make these reports available only for users of specific teams (with roles on report scope).
        Hi yuri and thanks for the reply. I thought about this and will keep it as last resort

        As I am able to retreive the required data using SQL, I might give a try to develop my own report as described here : https://forum.espocrm.com/forum/gene...vity-reporting

        Comment


        • #5
          I finally got it working using a custom function in formula following https://www.espocrm.com/documentatio...on-in-formula/.

          I created a formula that retrieve all the User Ids belonging to the current user teans and then check the logged-in user ID is present in this list on the report execution using complex expression filter.

          Comment

          Working...
          X