Let's clarify the "Sales Team Members" functionality and how to extend access to related records like Quotes and Orders.
Understanding the "Sales Team Members" Subgrid
You've correctly observed that the "Sales Team Members" subgrid doesn't directly correspond to a standard Dataverse entity you can browse. This is because it leverages Access Teams in Dynamics 365.
- Access Teams:
- Access Teams provide a way to automatically share records with a group of users and to grant them specific access rights to those records.
- The "Sales Team Members" subgrid on the Opportunity form is linked to a specific type of Access Team called an Owner Access Team.
- When you add a user to this subgrid with a specific role (e.g., Account Manager, Salesperson), you're essentially adding them to the Access Team for that particular Opportunity record and granting them the privileges defined by the Access Team Template associated with the subgrid.
- No Explicit N:N Relationship Entity:
- You're also correct that you won't find a standard intersect entity for a direct N:N relationship between Opportunity and User when using Access Teams in this way. The access rights are managed internally by the Access Team infrastructure.
- Access Team Templates:
- Your suspicion about Access Team Templates is accurate. The behavior of the "Sales Team Members" subgrid is governed by an Access Team Template that is configured for the Opportunity entity. This template defines the roles that can be assigned to team members and the default access rights they receive on the Opportunity record itself.
Granting Access to Related Quotes and Orders
Now, to your main question: how to automatically grant access to the Sales Team members on the Opportunity for the related Quotes and Orders. You're on the right track thinking about Power Automate.
Here's a potential approach using Power Automate:
Trigger:
The ideal trigger would be "When a row is added, modified, or deleted" on the "Opportunity Sales Team" (the intersect entity that's used behind the scenes for the Access Team). However, this entity isn't directly exposed for triggering in Power Automate in the standard way.
A more feasible trigger would be:
- "When a row is added, modified, or deleted" on the Opportunity entity itself.
Logic:
When an Opportunity record is modified (specifically when Sales Team members are added or their roles change), the flow will:
- Get the Sales Team Members: Retrieve the current Sales Team members associated with the Opportunity. You can do this by using a "List rows" action on the hidden "Opportunity Sales Team" entity, filtering by the specific Opportunity record's ID. You might need to explore the underlying schema name for this intersect-like structure.
- Grant Access to Related Quotes:
- Use a "List rows" action to get all the related Quote records for the Opportunity (using the Opportunity lookup field on the Quote entity).
- For each related Quote, use the "Grant access to a row" action (Dataverse connector) to share the Quote with each of the Sales Team members from step 1. You'll need to specify the Quote record ID, the user ID of the Sales Team member, and the type of access to grant (e.g., Read, Write, etc.).
- Grant Access to Related Orders:
- Similarly, use a "List rows" action to get all the related Order records for the Opportunity (using the Opportunity lookup field on the Order entity).
- For each related Order, use the "Grant access to a row" action to share the Order with each of the Sales Team members from step 1, specifying the desired access rights.
Finding the "Opportunity Sales Team" Entity:
To effectively filter in your Power Automate flow, you'll need the internal name of the entity that manages the Opportunity Sales Team members. You might be able to find this by:
- Examining the Relationship: In the Opportunity entity's relationships, look for N:N relationships to the User entity that seem related to sales teams or access. The schema name of the intersect entity for such a relationship is what you'd need.
- Using the Web API: You could use the Dynamics 365 Web API to query the entity metadata and look for entities with names or properties that suggest they manage Opportunity Sales Team memberships.
Alternative Trigger (Less Ideal but Possible):
If triggering directly on changes to the Sales Team proves difficult, you could consider:
- Triggering the flow when a Quote or Order is created or associated with an Opportunity. The flow would then look at the Opportunity's Sales Team and share the newly created Quote/Order.
In summary:
- The "Sales Team Members" subgrid uses Access Teams, not a standard N:N relationship entity you can directly browse.
- You can use a Power Automate flow triggered on Opportunity modification (or related Quote/Order creation) to retrieve the Sales Team members and then use the "Grant access to a row" action to share the related Quotes and Orders with them.