Indlæg

Dynamics 365 (CRM) on-premise cannot login using Plugin Registration Tool or Custom App using Tooling connector.

If all of a sudden you are unable to login via PluginRegistrationTool or other apps, reason can be the recent windows security update on CRM Server.

2020-01 Cumulative Update for Windows Server 2016 for x64-based Systems (KB4534271)

Removing this update restored our connection 🙂

Dynamics 365 CRM update/upgrade error: The UPDATE statement conflicted with the FOREIGN KEY constraint “solution_base_dependencynode”

Recently while upgrading (import db) CRM deployment from 2016 to v9 we encountered this strange error. After trying everything including mentioned her and running short of time, we opened MS ticket and got a script to run on organisation’s DB, which actually resolved this issue.
Script actually drops foreign key constraints so should be used carefully and at your own risk.

IF OBJECT_ID(‘tempdb..#DropForeignKeysStatement’) IS NOT NULL DROP TABLE #DropForeignKeysStatement

SELECT DropStatement = ‘ALTER TABLE [dbo].[‘ + st.name + ‘] DROP CONSTRAINT [‘ + sfk.name + ‘]’
INTO #DropForeignKeysStatement
FROM sys.foreign_keys sfk
INNER JOIN sys.tables st ON sfk.parent_object_id = st.object_id
AND sfk.schema_id = st.schema_id
WHERE sfk.schema_id = schema_id(‘dbo’)

SELECT DropStatement FROM #DropForeignKeysStatement

DECLARE dropStatementCursor CURSOR FOR
(SELECT DropStatement FROM #DropForeignKeysStatement);

OPEN dropStatementCursor;

DECLARE @currentStatement NVARCHAR(max);

FETCH NEXT FROM dropStatementCursor INTO @currentStatement;

WHILE @@FETCH_STATUS = 0
BEGIN
EXEC sp_executesql @currentStatement;

FETCH NEXT FROM dropStatementCursor INTO @currentStatement;
END

CLOSE dropStatementCursor;
DEALLOCATE dropStatementCursor;

IF OBJECT_ID(‘tempdb..#DropForeignKeysStatement’) IS NOT NULL DROP TABLE #DropForeignKeysStatement