web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Answered

"The given key was not present in the dictionary" error when creating new N:N relationship

(0) ShareShare
ReportReport
Posted on by 30

I'm trying to create a new many to many relationship between the oob Entitlement entity and a custom entity in Dynamics sales online v9.2.  I've published all customisations etc.  However whenever I try to save the relationship I'm getting the below error.  Has anyone else experienced this and can help me resolve it please?

Exception type: System.ServiceModel.FaultException`1[Microsoft.Xrm.Sdk.OrganizationServiceFault]
Message: System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
at Microsoft.Crm.CrmTransactionEventManager.InvokePreCommitTransactionEvents() +0x9a
at Microsoft.Crm.CrmTransaction.<CommitTransaction>b__11_0() +0xb
at Microsoft.PowerApps.CoreFramework.ActivityLoggerExtensions.Execute(ILogger logger, EventId eventId, ActivityType activityType, Action action, IEnumerable`1 additionalCustomProperties) +0x90
at Microsoft.Xrm.Telemetry.XrmTelemetryExtensions.Execute(ILogger logger, XrmTelemetryActivityType activityType, Action action) +0x13
at Microsoft.Crm.LegacySqlDataAccessContextImplementation.CommitTransaction() +0x44
at Microsoft.Crm.BusinessEntities.ExecutionContext.CommitTransaction(ProcessDependenciesOption option, FlushCacheOption flushOption) +0x0
at Microsoft.Crm.Metadata.RelationshipServiceBase.<>c__DisplayClass8_0.<CreateMultipleRelatedRelationshipsHelper>b__0() +0x20f
at Microsoft.PowerApps.CoreFramework.ActivityLoggerExtensions.Execute[TResult](ILogger logger, EventId eventId, ActivityType activityType, Func`1 func, IEnumerable`1 additionalCustomProperties) +0x91
at Microsoft.Xrm.Telemetry.XrmTelemetryExtensions.Execute[TResult](ILogger logger, XrmTelemetryActivityType activityType, Func`1 func) +0x0
at Microsoft.Crm.Metadata.RelationshipServiceBase.CreateMultipleRelatedRelationships(IRelationshipCreateInfo[] relationshipInfos, ExecutionContext context) +0x3a
at Microsoft.Crm.Metadata.RelationshipServiceBase.Create(IRelationshipCreateInfo relationshipInfo, ExecutionContext context) +0x16
at Microsoft.Crm.Metadata.RelationshipServiceBase.Create(IRelationshipCreateInfo createInfo, Guid solutionId) +0x4a
at Microsoft.Crm.Metadata.EntityRelationshipService.Create(IRelationshipCreateInfo relationshipInfo, Guid solutionId) +0x0
at Microsoft.Crm.Application.WebServices.SystemCustomization.RelationshipCreate.Execute(Guid solutionId, ParameterBag paramBag) +0x15c
at Microsoft.Crm.Application.WebServices.SystemCustomization.SystemCustomization.CreateRelationship(XmlNode data) +0x11: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #FE357C82Detail:
<OrganizationServiceFault xmlns:i="">www.w3.org/.../XMLSchema-instance" xmlns="">schemas.microsoft.com/.../Contracts">
<ActivityId>264de8f0-d8ee-4a23-a8e2-43563575d7fd</ActivityId>
<ErrorCode>-2147220970</ErrorCode>
<ErrorDetails xmlns:d2p1="">schemas.datacontract.org/.../System.Collections.Generic" />
<HelpLink i:nil="true" />
<Message>System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
at Microsoft.Crm.CrmTransactionEventManager.InvokePreCommitTransactionEvents() +0x9a
at Microsoft.Crm.CrmTransaction.&lt;CommitTransaction&gt;b__11_0() +0xb
at Microsoft.PowerApps.CoreFramework.ActivityLoggerExtensions.Execute(ILogger logger, EventId eventId, ActivityType activityType, Action action, IEnumerable`1 additionalCustomProperties) +0x90
at Microsoft.Xrm.Telemetry.XrmTelemetryExtensions.Execute(ILogger logger, XrmTelemetryActivityType activityType, Action action) +0x13
at Microsoft.Crm.LegacySqlDataAccessContextImplementation.CommitTransaction() +0x44
at Microsoft.Crm.BusinessEntities.ExecutionContext.CommitTransaction(ProcessDependenciesOption option, FlushCacheOption flushOption) +0x0
at Microsoft.Crm.Metadata.RelationshipServiceBase.&lt;&gt;c__DisplayClass8_0.&lt;CreateMultipleRelatedRelationshipsHelper&gt;b__0() +0x20f
at Microsoft.PowerApps.CoreFramework.ActivityLoggerExtensions.Execute[TResult](ILogger logger, EventId eventId, ActivityType activityType, Func`1 func, IEnumerable`1 additionalCustomProperties) +0x91
at Microsoft.Xrm.Telemetry.XrmTelemetryExtensions.Execute[TResult](ILogger logger, XrmTelemetryActivityType activityType, Func`1 func) +0x0
at Microsoft.Crm.Metadata.RelationshipServiceBase.CreateMultipleRelatedRelationships(IRelationshipCreateInfo[] relationshipInfos, ExecutionContext context) +0x3a
at Microsoft.Crm.Metadata.RelationshipServiceBase.Create(IRelationshipCreateInfo relationshipInfo, ExecutionContext context) +0x16
at Microsoft.Crm.Metadata.RelationshipServiceBase.Create(IRelationshipCreateInfo createInfo, Guid solutionId) +0x4a
at Microsoft.Crm.Metadata.EntityRelationshipService.Create(IRelationshipCreateInfo relationshipInfo, Guid solutionId) +0x0
at Microsoft.Crm.Application.WebServices.SystemCustomization.RelationshipCreate.Execute(Guid solutionId, ParameterBag paramBag) +0x15c
at Microsoft.Crm.Application.WebServices.SystemCustomization.SystemCustomization.CreateRelationship(XmlNode data) +0x11: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #FE357C82</Message>
<Timestamp>2021-05-24T11:46:14.8937852Z</Timestamp>
<ExceptionRetriable>false</ExceptionRetriable>
<ExceptionSource i:nil="true" />
<InnerFault i:nil="true" />
<OriginalException i:nil="true" />
<TraceText i:nil="true" />
</OrganizationServiceFault>

I have the same question (0)
  • meelamri Profile Picture
    13,216 User Group Leader on at

    Hi,

    Can you please share some screenshots ?

  • sfroude Profile Picture
    30 on at

    Hi Mehdi,

    Please see screenshots using the following link:

    https://imgur.com/a/NUXhKd4

  • Verified answer
    meelamri Profile Picture
    13,216 User Group Leader on at

    Hi, 

    I reproduced the same issue in my environment using the classic designer. It seems to be a bug.

    pastedimage1621862817713v2.png

    However, I managed to create this relationship through the new make.powerapps.com designer.

    pastedimage1621862710394v1.png

  • sfroude Profile Picture
    30 on at

    Thanks, that's worked.  I've raised a ticket with MS also to fix the classic interface.

  • meelamri Profile Picture
    13,216 User Group Leader on at

    Glad you managed to resolve your issue.

    Could you please give us some feedback after you get in touch with the support? Thank you.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 83 Super User 2025 Season 2

#2
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 49 Most Valuable Professional

#3
#ManoVerse Profile Picture

#ManoVerse 40

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans