Hi barbieruelas,
Let us confirm the background of the problem.
Team Z has three members. Members 1 and 2 belong to Territory A, and Member 3 belongs to Territory B.
You want Team Z to also belong to Territory B. In this case, for Member 3, as a user, he belongs to Territory B. As a team member, he belongs to Territory A.
Do you want to achieve this effect?
Please note that one user can only belong to one Territory, which is by design, that is to say, even if you assign Team Z to Territory A, in the business logic of D365, the Territory of Member 3 is still Territory B, he cannot Belongs to two Territory.
So, in my opinion, two situations can be achieved.
1. Create a 1: N relationship for the Territory entity and Team entity, or create a connection for Territory A and Team Z, so that Territory A and Team Z are related records. But Territory of Member 3 is still Territory B.
2. First create a 1: N relationship for the Territory entity and Team entity. Then create a Flow, triggered when a new Team is created and the Territory field of new Team contains value, or triggered when a Team is updated and the Territory field changes. List all users of this Team and set their Territory field to the Territory of this Team. In this case, every time the team is assigned to a Territory, the members will be automatically assigned to this Territory.
In this example, when Team Z is assigned to Territory A, Member 3 is automatically assigned to Territory A, and he no longer belongs to Territory B.
Which of these two situations is more appropriate for you?