Lookup Field Displays All Records - dynamics-crm

I'm building an employee self service portal via Dynamics 365, and when I use the lookup field to display my name in a form other employee names are displayed too:
I've been fiddling with the security roles for a while now and still cant seem to get it to display a single employee name.
I'm also planning to do it a different way by filling up the employee name based on the username on the upper right.
How do you guys suggest I go about this?

First things first. Portals won't use any CRM Security role concepts as it's for CRM users. Portal is built on top of Contact entity. Contact is Portal user & Web role will control his/her access.
You have to Entity Form Metadata to populate the fields per your need. The contact lookup can be filled in by current login Portal user this way. Even you can implement something like manage/restrict the Contacts only from your parent Account in that lookup easily.

Related

"Created By" field in each record in Custom entity is showing "system" for each user

I am working on a custom entity on dynamic 365. This entity is manipulated on Dynamic 365 Portal using web forms. Whenever I am creating a record in the entity, it is showing "System" in out of the box "Created By"column. Can anybody tell me what is the reason behind it?
As explained above, the owner of a record in CRM is a lookup field to systemuser entity.
The portal user is actually a contact, therefor can not be assigned as record owner.
Owner, createdby, modifiedby = CRM Login user = systemuser Entity. It can be licensed user, application user (service account), or SYSTEM (only used by CRM product).
Portal Login user = contact Entity (sometimes Lead).
Records (OOB or custom entity) created in portal will be impersonated by product using SYSTEM user while creating in CRM DB. Because contact cannot be an owner or createdby. This is the reason.
You may customize to have another custom attribute called new_createdby_portaland use Entity Form Metadata mapping to capture this field from portal side without code.

Trying to associate a dynamics portal user with a dynamics entity record through the portal

So I have a Dynamics 365 solution with a portal. I have created a custom entity to hold records relating to events. What I need to do is provide a way for users to log into the portal and register their interest for these events i.e associate their contact record with the relevant event record.
I have seen that in CRM there is the option to associate the current user to an event when they create one through an insert entity form in the portal, but I can't figure out how to do it from a read-only entity form.
You have to use & configure Entity Form Metadata in entity form, so that the data can be pre-populated including current login portal user as contact in each record.
https://community.adxstudio.com/products/adxstudio-portals/documentation/configuration-guide/entity-form/entity-form-metadata/

Access records created by CRM users in D365 Portals

As I understand, we can access records created by Portal users and their respective Entity Permissions apply for them. However, I wanted those users to be able to even access records which were created by CRM users within Dynamics 365 (and not records created from Portal by a Portal user which is assigned to System)
Is this possible? If yes, how can I achieve that?
Thanks in advance!
It does not matter who created the record, what matters is if that user has access to it. It would not make much sense to show only records that were created by the portal users - how would you then handle something like Customer Service (on one end users use portal, but on the other they are using CRM, bot are creating records).
So basically I'm not sure how aware are you of the configuration of permissions, but let's say that you configured that a Contact (which is a portal user) has access to all records "Cases" that are referencing this contact (this is simply configuration in Entity Permission record). If yes then contact will see records created by him and all other cases that are referencing him as a contact, so if you as a CRM user will create a Case for a Contact, this Contact will see the case.

How do I access security role in cloudkit

I am building an app with Role based Security. I have built my Record Types (Projects, Accounts, HistoryLog, Financial, Customer, etc) in Cloudkit Dashboard, and I have created Security Roles as well. I have roles named: Executive and DeptManager. I have assigned to the Record Types the appropriate access by Role. I have also assigned to the user in the special Record Type "Users" the role of either Executive or DeptManager.
I have successfully accessed and manipulated data in the Record Types. Now I am implementing Role based viewing in the App. So on the first view there is a log in "like" feature, so after i discover the user, I want to display the Roles of that user in a PickerView for them to select. Once they select a role I will them take them to the appropriate view. For example I may have the role of both DeptManager and Executive. If today I select DeptManager, I will be taken to a view that allows me to enters Production Metrics. If another day I select Executive, I will see performance metrics for all the departments that report to me.
Here is an image from CloudKit Dashboard showing the info I'm trying to retrieve. Thanks in advance for any advice.
Currently it is not possible to get the roles a user is in. At the moment the information that is returned from the discoverUserInfoWithUserRecordID is very limited. I also hope it will be extended soon. Currently you only get a userRecordID, first name and last name. If you do want such functionality, then the only solution is creating a shadow registration which you could query. You then would have a challenge keeping these 2 in sync. That has to be done manually.

Allow a contact to view cases across multiple accounts Dynamics 365 Portal

I'm working with a Customer Self-service Portal instance in Dynamics 365 and have the possibility of a contact(user) being linked to one or more accounts via a Many-to-Many relationship. I'm trying to find a way to change the out-of-the-box Case entity list to show cases for any account the contact is linked to with this new relationship but so far haven't found anything that will work. I have considered just replacing the entity list view with some custom fetchxml in Liquid code, but I'm thinking the entity permissions for Case would have to be global then, instead of Contact or Account scope? I'm looking for a way to make this work with entity permission at Contact or Account scope.
I tried changing the account entity permission to use the new Many-to-Many relationship I created so that the current contact/user should be able to access all the accounts they are associated with, but I'm missing how to get to the next step of then showing all cases for those accounts.
Any suggestions? thank you!
Ok,I found the missing piece to make this work. Once I had the entity permission to the account entity (let's call it Account of Contact) using the new Many-to-Many relationship (contact to account), I then created another entity permission record for the Case entity with a scope of Parent and selected the "Account of Contact" permission as the parent, and picked the existing incident_customer_account relationship. Once this was parented, I was able to go to the out-of-box support home page and view all cases for accounts my contact was associated with via the Many-to-Many relationship.

Resources