Skip to main content
Dynamics 365 general forum
Answered

Power Portal with Dynamics 365: Restrict entity records on Portal page

editSubscribe (0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello Community,

Does anyone know how to restrict the display and access on Dynamics 365 entity records on the Power Portal page?

For example, if I use the Power Portal and set up a page on the portal to show the contact entity records from Dynamics 365 to the external Portal users, how can I set it up so that the Portal users can only see the contact records that they are supposed to see instead of seeing all the contact records in Dynamics? And to be clear, the portal users are not users of Dynamics, and therefore they don't own any records in Dynamics. They are simply Portal users.

Any feedback would be appreciated.

Thank you!

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Power Portal with Dynamics 365: Restrict entity records on Portal page

    Hi Devon,

    I meant to reply earlier that this is extremely helpful the information you have provided! Thank you so much!!

    I have one additional question if you don't mind me picking your brain further :)

    In our scenario, we have the client Intranet running on SharePoint Online. The client has Office 365 login to access the Intranet. After login, if client users click on a link on the Intranet to open the Power Portal web site, how can we help ensure the user experience so that they are automatically login to the Power Portal site as well, without needing to do another login? Is that possible?

    Thanks,

    Eric

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Power Portal with Dynamics 365: Restrict entity records on Portal page

    Hi Devon,

    I meant to reply earlier that this is extremely helpful the information you have provided! Thank you so much!!

  • Verified answer
    DevCrm16 Profile Picture
    DevCrm16 215 on at
    RE: Power Portal with Dynamics 365: Restrict entity records on Portal page

    Eric,

    We have a similar requirement where we have a web role called "Client Rep" where that portal login (non-dynamics user) can see all related contact records and specific associated records to those contacts based on the account they have in their "parentcustomerid" contact field.

    On the contact record you should see a field with a schema name of parentcustomerid in our system we have the display name as "Employer"

    If you have that set on both the account admin contact records with a custom web role and all the contact records associated with that account you want the rep to be able to view also have the parentcustomerid field set to the same account you can use the same scenario we listed above but this time use the "Account Attribute" in the Filter Conditions instead of the Portal User Attribute. Again make sure you have entity permissions set up for every entity you want the account rep to be able to see and you have the custom web role assigned to each of those entity permissions.

    If you needed one rep to see multiple accounts you could accomplish this by creating a second custom lookup field on the contact record to the account entity and creating a second entity list (I.E Entity list 1 = Primary Account, Entity List 2 = Secondary account). This is not ideal as you either have to make 2 web pages or you have to use custom web template to display both entity list on the same page but it is fully supported OOB. Option 2 would be to create custom fetchXML and web template to create the results for the entity list. But again that does require a certain amount of custom script.

    We tend to lead towards the custom fetchxml just because it is more flexacble but you can definitly get there on a no-code route with entity list. Here's the resource we used originally to learn the fetchxml option: dyn365apps.com/.../

    I can also give you examples of how to use liquid tags to pull down current user information into the fetch query if needed.

    Thanks,

    Devon

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Power Portal with Dynamics 365: Restrict entity records on Portal page

    Hi Devon,

    Thank you very much for your reply and inputs!

    Yes, what you have described is fairly close to the requirement I am examining for the client. In my scenario, it's something like this:

    - We have a portal user, who may or may not exist as a corresponding contact record in Dynamics

    - In Dynamics, we have thousands of contact records, representing members from various offices. Each office is tracked as an Account record in Dynamics, but currently there is no association between the member contact record and the office account record in Dynamics.

    - The portal user represents an office admin. Again, this portal user is not a Dynamics user, and may or may not exist as a contact record in Dynamics.

    - Upon login to the portal, what the portal user would like to see is the list of contacts from Dynamics, but only the contacts that belong to the same office as the portal user

    I am seeing some challenges trying to achieve the above requirement based on the current setup in the client system. Since there is no association between the contact and account record in Dynamics, and since all contacts in Dynamics are owned by a generic service account user, I couldn't see an easy way how I could configure to filter and only display the contacts from the same office as the login portal user on the portal web page.

    I believe your suggestions above would only work if (1) the portal user has a corresponding contact record in Dynamics, and (2) there is lookup relationship on the member contacts in Dynamics to the portal user's contact. I am also not sure if this is something that would be feasible in my scenario since it will involve a mass data update, which won't be easy to do because the client's scenario could involve the same member contact belonging to one or multiple offices.

    Do you see any potential solutions (without coding if possible) that I might have overlooked based on the scenario I described above?

    Thank you very much!

  • Verified answer
    DevCrm16 Profile Picture
    DevCrm16 215 on at
    RE: Power Portal with Dynamics 365: Restrict entity records on Portal page

    Assuming I am reading your question correctly you have a portal user authenticated to a dynamics contact record and you want to only show the associated records that belong to that user for a given entity such as sales, opportunities, MyCustomEntity, etc...

    If that is correct make sure when you create a new entity list to be surfaced on your webpage you need to go to the "Filter Conditions" section and select the contact field on the drop down for the field "Portal User Attribute" that ties the logged in user to the record.

    Assuming you have set up the proper entity permissions for the associated entity/webroles the user should only see records on the resulting entity list that have their contact record listed in the lookup field.  

    If you are using FetchXML and liquid to create your list let me know and I can send you resources for that as well as it's fairly straightforward but does require you to create your own table with HTML to display the results.

Helpful resources

Quick Links

New Blog Features Released!

Check out the new community blog features for viewers and authors…

Demystifying Copilot with Sundar Raghavan

Sundar explains how Copilot for Service is meant to function separately...

Business Process Guidance Badges and New…

The Microsoft Success by Design is the framework for implementing Dynamics 365…

Leaderboard

#1
Andre Arnaud de Calavon Profile Picture

Andre Arnaud de Cal... 283,244 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 222,939 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,140

Featured topics

Product updates

Dynamics 365 release plans