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
You Sir, are a genius, works a charm :)
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).
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156