Fix Duplicate Record Found For Entity Error - Dynamics 365 Portals

This article is about fixing “Duplicate Record Found for Entity error..” in Dynamics 365 Portals.This way we can hide inactive records to show on the lookup view.

Introduction

This article is about fixing “Duplicate Record Found for Entity error” in Dynamics 365 Portals.

Details

Sometime Dynamics 365 CE displays a confusing error, for example recently one user got the  following error while assigning a Web Role to a user:
Fix Duplicate Record Found for Entity Error – Dynamics 365 Portals 

This error seems confusing as it’s saying Duplicate error, but when I looked into this issue, I found this issue was occurring because the user was trying to assign an inactive Web role to a portal user.

For example, in the below first screen you can see Partner Manager web role is inactive but when you click on Add Existing button under contact to assign Web Roles to the user it will still show you an inactive web role.

 Fix Duplicate Record Found for Entity Error – Dynamics 365 Portals
 
In order to solve this issue, I simply modified filter in lookup view using the following steps.
  • Create your custom solution and add Web Role entity under that solution or open default solution.
  • Navigate to Web Role entity -> Views and open Web Role Lookup view
Fix Duplicate Record Found for Entity Error – Dynamics 365 Portals
 
 > Click on Edit Filter Criteria and add filter for status equal to Active
 
Fix Duplicate Record Found for Entity Error – Dynamics 365 Portals
 
Save and publish your changes.

Now we should not be able to see inactive web roles while trying to assign web roles to portal users.
 
Fix Duplicate Record Found for Entity Error – Dynamics 365 Portals
 
This way we can hide inactive records to show on the lookup view. Stay tuned for more Dynamics 365 content!!