Category Archives: Exceptions and errors

XrmServiceToolkit (2.0.0) JQueryXrmCustomFilterView in IE10 / IE11 / jQuery 1.7.2

Working with IE 10 or 11, we had the problem at work that we were unable to use the JQueryXrmCustomFilterView due to exceptions being thrown.

We have jQuery 1.7.2 as is stated as the lowest required jQuery version in the XrmServiceToolkit.

When inspecting the XrmServiceToolkit, I’ve found a bug in the function “xmlToString(xmlData)” (line 3624):

[code language=”js”]
//IE
if (window.ActiveXObject) {
xmlString = xmlData[0].xml;
}
[/code]

the correct code should be:

[code language=”js”]
//IE
if (window.ActiveXObject && typeof xmlData[0].xml !== "undefined") {
xmlString = xmlData[0].xml;
}
[/code]

Unable to filter custom SSRS Reports

A colleague of mine approached me today about record filtering in custom SSRS Reports. According to the MSDN link at the bottom of this post, using the CRMAF_ prefix enables automatic filtering based on the user’s record selection in Dynamics CRM when running the report. However, we were unable to produce the correct filtering on the report: it would always revert to the default 30-day filter.

After digging in, we found the problem: the first time you upload the report, if you did not use the CRMAF_ prefix, it will not apply any filtering even if you update the report with an new RDL file. You will have to delete your report from Dynamics CRM, and create a new report.

This link is really usefull when creating SSRS reports:

Create Reports for Microsoft Dynamics CRM Using SQL Server Reporting Services

Assignrequest: Unsupported entity type while converting to security principal

The other day at work, I encountered the following error message, one for which I could not find a solution online. (Unfortunately, some of the text is in Dutch. However, the error message is in English and the error code is universal!)

Error detail: Unsupported entity type while converting to security principal
Error code: -2147220891
Error:

[csharp]
Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: Er is een onverwachte fout opgetreden, probeer het later opnieuw. Neem contact op met uw systeembeheerder indien dit zich vaker voordoet. Foutinformatie: Unsupported entity type while converting to security principal
Detail:
-2147220891
OperationStatus
0

Er is een onverwachte fout opgetreden, probeer het later opnieuw. Neem contact op met uw systeembeheerder indien dit zich vaker voordoet.
Foutinformatie: Unsupported entity type while converting to security principal

[(..details left out for customer discretion..)]
[5f789a7e-1037-e311-b1ea-005056b615c4: PostAccountUpdate]
Now running under user id 67e96c02-99d1-e211-b13f-005056b615c4., Correlation Id: 258be446-76fc-423a-bc8b-f8f3587ed188, Initiating User: 67e96c02-99d1-e211-b13f-005056b615c4
Entered (..details left out for customer discretion..).Execute(), Correlation Id: 258be446-76fc-423a-bc8b-f8f3587ed188, Initiating User: 67e96c02-99d1-e211-b13f-005056b615c4
(..details left out for customer discretion..) is firing for Entity: account, Message: Update, Correlation Id: 258be446-76fc-423a-bc8b-f8f3587ed188, Initiating User: 67e96c02-99d1-e211-b13f-005056b615c4
<strong><span style="text-decoration: underline;">Fatal Error: </span><span style="text-decoration: underline;">Unsupported entity type while converting to security principal</span></strong>
Server stack trace:
at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
Exception rethrown at [0]:
at Microsoft.Crm.Sandbox.SandboxOrganizationService.Execute(String operation, Byte[] serializedRequest)
at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext)
Exception rethrown at [1]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at Microsoft.Crm.Sandbox.ISandboxOrganizationService.Execute(String operation, Byte[] serializedRequest)
at Microsoft.Crm.Sandbox.SandboxOrganizationServiceWrapper.ExecuteInternal(OrganizationRequest request)
at (..details left out for customer discretion..)
at (..details left out for customer discretion..)
Exiting (..details left out for customer discretion..).Execute(), Correlation Id: 258be446-76fc-423a-bc8b-f8f3587ed188, Initiating User: 67e96c02-99d1-e211-b13f-005056b615c4

[/csharp]

The lines of code that caused this error were:

[csharp]
var assignRequest = new AssignRequest()
{
Assignee = team,
Target = account
};

organisationService.Execute(assignRequest);
[/csharp]

Closer inspection of the assignment of the team variable (which in code is assigned to the Assignee property) showed that it was not an EntityReference to a record of entity type SystemUser or entity type Team.

The Assignee must always be an EntityReference to a record of entity type SystemUser or Team, or you will encounter the exception as shown in this post.

Unable to create workflow process due to Workflow Activity (error code -2147220970)

Today, at our customer’s site, I needed to create a Workflow Process. When I first created the Workflow Process, it was successfully created and the included into the solution. However, when I wanted to edit the Workflow Process, I encountered an error. Since the development machine is shared across multiple Organizations, at first I thought this could be due to somebody importing a new solution or creating a new Organization.

I deleted the Workflow Process and tried to recreate it. However, this time even the creation of the workflow failed. CRM 2011 threw me the following exception: System.Xaml.XamlObjectReaderException

After some research on the web, I was hinted by the error code that this exception could be caused by a Workflow Activity programmed for CRM 4.0 and deployed to CRM 2011. I looked at the most recently added asset that was just deployed to our server. This asset indeed had a Workflow Activity as part of the solution’s deployment project that was not adapted to CRM 2011. After removing this Workflow Activity from CRM using the Plug-in Registration Tool, CRM 2011 operated normally again.