cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mihamocnik
Helper I
Helper I

What is the best way to show list of records related to two lookups - Account & Parent Account?

Hi All!

 

currently, we are showing to the user a list of records that are related to the Account but our client would like to see the mentioned list + list of records that are related to the parent Account of that Account. 

 

Is there any best practice here how to handle this scenario?

 

Best regards,

Miha 

 

1 ACCEPTED SOLUTION

Accepted Solutions
justinburch
Microsoft
Microsoft

Hi @mihamocnik,

You will need to create a set of entity permissions to handle this. Note that this is going to push you toward the link-entity limits. At a high level, you'll need to be aware that all queries for entity X (your 'related to my account' entity) will enforce a rule of "Show me X where the Account is ABC or Account DEF (parent) has a LINK to Account ABC and DEF has a LINK to X", and if entity X has child relationships - say entity Y, you'll need to add 2 permissions, one for each possible route. All of this grows the links exponentially, and you are limited to 10. This may not apply, but just in case, I've broken down a bit of it here with some tips: https://justinburch.com/portal-security-1/#MultipleEntryPoints - scroll up slightly in the link to see the content.

For the solution:

  1. Assuming you don't already have a permission for the parent account: Create Entity Permission for Account where Scope = Account, Account Relationship = account_parent_account, Privileges = none (unless you need them)
  2. Create Entity Permission (can use +New Entity Permission in "Child Entity Permissions grid") for Entity X where Scope = Parent, Parent Entity Permission = permission created in Step 1, Parent Relationship = (whatever relationship exists for Account -> Entity X), Priveleges: Read (at minimum)
  3. Add permission from step 1 to intended Web Roles - note that step 2's permission will automatically apply

 

Edit: Also, where is the list? if it's an "Entity list", then all you need is the above (assuming no weird filters on the view), but if the list in a subgrid with "Related Records" selected on a form, you'll need to remove the "Related Records" filter and make sure you have Entity Permissions for Account setup instead.

View solution in original post

4 REPLIES 4
justinburch
Microsoft
Microsoft

Hi @mihamocnik,

You will need to create a set of entity permissions to handle this. Note that this is going to push you toward the link-entity limits. At a high level, you'll need to be aware that all queries for entity X (your 'related to my account' entity) will enforce a rule of "Show me X where the Account is ABC or Account DEF (parent) has a LINK to Account ABC and DEF has a LINK to X", and if entity X has child relationships - say entity Y, you'll need to add 2 permissions, one for each possible route. All of this grows the links exponentially, and you are limited to 10. This may not apply, but just in case, I've broken down a bit of it here with some tips: https://justinburch.com/portal-security-1/#MultipleEntryPoints - scroll up slightly in the link to see the content.

For the solution:

  1. Assuming you don't already have a permission for the parent account: Create Entity Permission for Account where Scope = Account, Account Relationship = account_parent_account, Privileges = none (unless you need them)
  2. Create Entity Permission (can use +New Entity Permission in "Child Entity Permissions grid") for Entity X where Scope = Parent, Parent Entity Permission = permission created in Step 1, Parent Relationship = (whatever relationship exists for Account -> Entity X), Priveleges: Read (at minimum)
  3. Add permission from step 1 to intended Web Roles - note that step 2's permission will automatically apply

 

Edit: Also, where is the list? if it's an "Entity list", then all you need is the above (assuming no weird filters on the view), but if the list in a subgrid with "Related Records" selected on a form, you'll need to remove the "Related Records" filter and make sure you have Entity Permissions for Account setup instead.

View solution in original post

@justinburch ,

 

I have just one additional question 🙂

 

What if we have another child GHI account where DEF is also the parent. Is it possible to see records related to all of these ABC, DEF, GHI with this entity permissions solution?

 

Best regards,

Miha

Hi @mihamocnik,

That's possible, but again will increase your link-entity count a little bit. To do so, you'll just add the following two Entity Permissions:

  1. Entity Permission for Account where Scope = Parent, Parent Entity Permission = permission created in previous Step 1 (for parent Account), Parent Relationship = account_parent_account, Privileges = none (unless you need to allow Accounts to read sibling Accounts)
  2. Entity Permission for Entity X where Scope = Parent, Parent Entity Permission = permission created in this Step 1 (for child Account), Parent Relationship = (whatever relationship exists for Account -> Entity X), Privileges: Read (at minimum)

In the end, you would have something like this:

image.png

Note that the first permission should have been named "Entity X - My Account's Entity X" for consistency, but hopefully it's still easy to visualize.

Thank you @justinburch !

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (2,868)