Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

Saving issue plugin - Not found in dictionary - Case Description Only

Posted on by Microsoft Employee

Hi,

Further to a previous post about not getting attributes through to my plugin, which now works, however I have noticed a problem, as the Case description is the last field our users will fill out, they will automatically do CTRL+S to save the record.

However, if they are still in the description field the plugin fires the old Key not found in dictionary error, HOWEVER, if I cause the description field to lose focus, ie: click out of it or move to another field and do CTRL+S all is good.  Also clicking the save icon in the bottom right cause all to be good.

So the question is why when saving within the description box am I getting the error, and what is the work around for it?

*This post is locked for comments

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Saving issue plugin - Not found in dictionary - Case Description Only

    You Sir, are a genius, works a charm :)

  • Verified answer
    Michel van den Brink Profile Picture
    Michel van den Brink 4,697 on at
    RE: Saving issue plugin - Not found in dictionary - Case Description Only

    You are likely using entity.Attributes["description"] in your plug-in code to read the contents of the description field. This will throw that exception if the description is not omitted into the record.

    It's recommended that you always use entity.GetAttribute<string>("description") to read your attributes, as this will simply return NULL if there is no value for your field (or a different default value, for different types, based on default(T) )

      

    The description value will not be committed to the record while a user is still typing, which is what the Dynamics assumes, if you don't exit the field first (make it lose focus).

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!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans