Friday, 24 November 2023

View Records shared with an “Access Team”

 View Records shared with an “Access Team”

I had a really simple requirement the other day but it took me time to work out the solution! So I thought I would describe my challenge and the solution …. in an attempt to help others. In this post I will explain how to create a view of records shared with from an access team.

Before I show creating a view to see all opportunities shared with me from access teams …. I thought I should first explain what an Access Team is and how we create one!

What is an Access Team?

Access Teams are dynamic or temporary teams that are used to grant access to a specific record. A common use might be on opportunities … a sales person may own an opportunity but needs others to collaborate on the potential sale with them. In this scenario they could add users into an access team on the opportunity form. This would grant the users access to just the specific opportunity shared.

Creating an Access Team

We first create an “Access Team Template”. Then add a sub grid onto our form. (Users can then be added to the team from that sub grid.)

Create Access Team Template

In the advanced settings area of Dynamics 365 under security you will find an ” Access Team Templates” option. (As shown below.)

Below you can see that I have created a team template which grants permissions on the opportunity entity. In my example user can see and update my opportunities. They can also associate (aka append) records to this opportunity and associate this opportunity with other records. But I will not allow anyone to delete, share or reassign my opportunities.

Add subgrid onto the Opportunity Form

Below you can see the settings I used when adding a sub grid to my form.

FYI: I found I needed to use the classic form editor to do this! Adding the grid using the newer form editor did add the sub grid to my form but when I opened an opportunity it showed all users in the grid. So I removed the grid and re-created using the classic form editor. That worked perfectly.

Notice that the records option says “All Record Types”. And that the entity is “Users”. I then select a “special” view called “Associated Record Team Members”. And finally I selected the Access Team Template I’d already created for opportunities.

Now I have a sub grid on my opportunity we can add users into the grid. Everyone added into this access team would then be able to collaborate on this opportunity.

My View

Having setup my access team I was asked “how would a user find all the opportunities shared with them?”. This is a very simple and probably essential request. But as I mentioned in my opening I didn’t immediately know how to achieve this.

Obviously creating a view of all the opportunities owned by a user is a simple and common request. We’d just filter the view using something like “owner equals correct user”.

I needed to create something similar but instead of looking at the owner field I needed to filter opportunities when the current user is a member of the access team. The filtering I used is shown below.

Notice that I have first connected to a related table. This is “Team (Regarding Object Id)”. Doing this will return me all opportunities with an access team associated with them.

Then from the Team table I connect with another related table, this time I selected the many to many relationship between Team and users. Finally I could add that my “user” field “equals current user “. This filters on opportunities with me as a member of the access team.

Below you can see I have shown the same query using the older style “advanced find” interface. Just in case you happen to prefer seeing the queries represented like this!

As you can see this was a simple change but as I didn’t instantly know the answer I hope these details might help anyone facing the same challenge. Enjoy.

No comments:

Post a Comment

Power Apps Drag & Drop Kanban code sample

  Introduction: The Kanban Board App Developers at a software company use the Kanban board to show their progress on development tasks and b...