[CRM 2016] Error code #0x80040237. Error while solution import. Cannot insert duplicate key.

We were deploying from sandbox to production with one of the solutions. And for no reason, the solution import failed on all attempts with error code #0x80040237. And there was not much description given except – “Cannot insert duplicate key”. This was the error on one of the entities.

First, we followed a post by a friend on the same error. We even removed some data to check if that is the case. But, the import failed again with the same error code and description.

Then, we came across similar question on MSDN. Question was already showing an answer that by removing <CustomControlDefaultConfigs> section from Solution.xml this can be resolved. This issue is already taken care on Dynamics 365. However, CRM 2016 Online, this issue still persists.

Resolution:

  • Extract your solution zip file.
  • Open solution.xml file in a text editor.
  • Search for the <entity></entity> tag for the entity on which your solution import is showing the error.
  • Find and remove <CustomControlDefaultConfigs> section inside the <entity> section.
  • Save the solution.xml file and create new zip file from the extracted solution contents.
  • Import will be successful this time!!

The reason to remove <CustomControlDefaultConfigs> section from solution.xml file is still not known. And there are other option also available like updating sql to resolve this error for on premise deployments. However, CRM Online users do not have any option but to modify solution.xml file.

Hope this helps!

Access to Microsoft Dynamics CRM has not yet been fully configured for this user. The user needs at least one security role before you can continue.

I ran into an issue when I was importing a different version  of solution to the organization. The error was:

Access to Microsoft Dynamics CRM has not yet been fully configured for this user. The user needs at least one security role before you can continue.

I was not able to find anything on google/bing for the specific error, but one of the blog I found said the error can be from business rules or other type of processes.

After some research, I came to know that there were multiple Business Rules on the organization which were owned by users who were deactivated and no longer have anything to do with CRM Development.

Resolution:
To resolve this issue, you just  need to assign the Business Processes or other workflows to any active user.

Step 1: Use Advanced Find feature to find the processes and their respective owners.

Advanced Find - Business Rules
Advance Find Business Rules

 

Step 2: Select all results which shows owner who are already disabled.

Advanced Find Result

Advanced Find – Result

Step 3: Assign the Business Rules/Processes to your user account or another user who is in active state.

Assign

Assign processes

And you’re done!! Try to reimport the solution and the error will be gone forever…

CRM 2016 + JavaScript: Web Resource cannot be reloaded

Since we got upgraded to CRM 2016 from CRM 2015, we faced a strange issue with JavaScript and Web Resource (html).

At some point of time the script goes to reload the html Web Resource with the following code:

var webResource = Xrm.Page.getControl("WebResource_ControlName");
webResource.setSrc(webResource.getSrc());

Easiest way to reload the web resource!

But the same code does not work in case of CRM 2016. As the web resource was already loaded when the page was loaded. CRM 2016 treats the same web resource not to be loaded again (may be for better performance!).

After trying numerous ways to solve, following code worked perfectly:

var webResource = Xrm.Page.getControl("WebResource_ControlName");
webResource.setSrc(Xrm.Page.context.getClientUrl() + "/WebResources/new_webResource?data=someValue%26ver%3D" + Math.random());

Here, I had to pass some parameters. What I have done to modify is added another parameter called “ver” (you can have any other parameter name instead of “ver”) and the value will be rendered from Math.random() method. This way the web browser treats each URL as a new request as Math.random() will return random number each time it will be executed.

Microsoft Ebooks huge collection… Free free free!!

Huge collection of Free Microsoft eBooks for you, including: Office, Office 365, SharePoint, SQL Server, System Center, Visual Studio, Web Development, Windows, Windows Azure, and Windows Server

http://blogs.msdn.com/b/mssmallbiz/archive/2013/06/18/huge-collection-of-free-microsoft-ebooks-for-you-including-office-office-365-sharepoint-sql-server-system-center-visual-studio-web-development-windows-windows-azure-and-windows-server.aspx

Large collection of Free Microsoft eBooks for you, including: SharePoint, Visual Studio, Windows Phone, Windows 8, Office 365, Office 2010, SQL Server 2012, Azure, and more.

http://blogs.msdn.com/b/mssmallbiz/archive/2012/07/27/large-collection-of-free-microsoft-ebooks-for-you-including-sharepoint-visual-studio-windows-phone-windows-8-office-365-office-2010-sql-server-2012-azure-and-more.aspx

Wello Horld!!

Hi everyone!!

At last… The time has come and I am writing my first blog post…

Wello Horld!! All my programmer friends would have understood what it says… (just to keep it different)

Stay tuned here for more tricks & tweaks, lot more coding examples and lot more fun stuff.

Signing off for now. Bye.

Rikin Shah