CAN’T DELETE AN EMAIL FROM MICROSOFT DYNAMICS CRM 2011
Some days ago, I faced an issue regarding CRM audit feature. A customer was unable to close an active case since there was an open activity related to it. Then I told him to close all open activities before closing a case because that`s the way it works. However, he was unable to close the activity because CRM had experienced an error.
The activity that my customer was trying to close was a draft email (in fact, he wanted to delete the email, but he was unable to, though). When I took a look at it, I found that some recipients (highlighted in red) were not resolved in CRM.
“The Web Service
plug-in failed in OrganizationId:
0d469757-a137-46d1-8f38-12a6d65f79a5;
SdkMessageProcessingStepId:
b92673ed-dc92-442b-a6c6-82f2fce14585; EntityName: email;
Stage: 25; MessageName: Delete; AssemblyName:
Microsoft.Crm.AuditMonikerMessagesPlugin,
Microsoft.Crm.Audit, Version=5.0.0.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35; ClassName:
Microsoft.Crm.AuditMonikerMessagesPlugin; Exception:
Unhandled Exception:
System.Collections.Generic.KeyNotFoundException: The
given key was not present in the dictionary.
at
System.Collections.Generic.Dictionary`2.get_Item(TKey
key)
at Microsoft.Crm.AuditHelper.GetXrmValue(Object
attribute)
at
Microsoft.Crm.AuditMonikerMessagesPlugin.BuildDeleteData(StringBuilder
attributeMaskBuilder, StringBuilder
changeDataBuilder, Entity preEntity, EntityMetadata
entityMetadata, IPluginExecutionContext context)
at
Microsoft.Crm.AuditMonikerMessagesPlugin.BuildChangeData(String&
attributeMask, EntityMetadata entityMetadata,
IPluginExecutionContext context)
at
Microsoft.Crm.AuditBase.LogAuditData(IPluginExecutionContext
context, Guid objectId, Boolean
allowEntityOnlyAudit, Entity entity, EntityMetadata
entityMetadata)
at
Microsoft.Crm.AuditMonikerMessagesPlugin.Execute(IServiceProvider
serviceProvider)
at
Microsoft.Crm.Extensibility.V5PluginProxyStep.ExecuteInternal(PipelineExecutionContext
context)
at
Microsoft.Crm.Extensibility.VersionedPluginProxyStepBase.Execute(PipelineExecutionContext
context)
I hope this helps.
Nicolás Brandl