Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Error when creating new phoneCall entity due to marketing campaign response

Posted on by Microsoft Employee

Hello everyone.

I have developed a MS Dynamics integration that uses the XRM SDK to create phoneCalls. One of the customers that uses the integration, however, is having an error when trying to create a call. I did some debugging, and the error that is being thrown says: 

"Unexpected exception from plug-in (Execute): ****.Crm.Plugins.PhoneCall.SetCampaignResponse: System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary."

To be more specific, this error happens whenever I call the IOrganizationService.create to try to create the call in the customer's MSDynamics instance.

I understand that this error is thrown when the code tries to access a non-existing property from a dictionary, but I couldn't extract any more useful information from the stack trace. I believe it would help a lot to figure out which key is not present in the payload or at least how can I get more details about this error.

Any help would be appreciated. 

*This post is locked for comments

  • TomSmelser Profile Picture
    TomSmelser 1,570 on at
    RE: Error when creating new phoneCall entity due to marketing campaign response

    These are tricky. Very basic method would be to show tracing messages to display the fields you are using. Just before your create statement. Then view trace log to see where it fails.

    Something like: tracingService.Trace("Field1=" + object.fieldname);

    Tracing example here:

    community.dynamics.com/.../implementing-tracing-in-your-crm-plug-ins

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans