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 :
Microsoft Dynamics CRM (Archived)

Workflow error - Given key was not present in the dictionary.

(0) ShareShare
ReportReport
Posted on by 485

Hi there,

I have seen this issue since CRM 2013, but I am just very surprised that it hasn't been fixed by Microsoft. 

Basically, if we have a Check Condition in workflow to check whether a lookup record exist or not, it will fail with error 'Given key was not present in the dictionary' if the lookup record exists without primary name (or blank). This issue occurs on any system and custom entities.

To replicate this issue:

1. Create the workflow:

a. For any entity, I use Email in my example. Use synchronous for immediate result, same error will occur in sync/async.

b. Add Check Condition, where Regarding (Case)->Case contains data.

c. Create a new Task, populating the Task->Subject with Case->Case Title. Publish the workflow.

2. Go to customisation, and make the Case Title optional.

3. Create the test record, ie. new Case without Case Title. Then, create a new draft Email regarding the Case above.

4.  Then, run the workflow created above on the Email. The workflow will fail. However, if you populate the Case Title with some text, then run the same workflow. The workflow will successfully create the Task record.

In real business scenario, this error is problematic when we have Case Creation Rule creating new Case from emails, and the inbound Email does not have a subject. Hence, the Case is created without Title, then the workflow failed.

Although, I could create new synchronous workflow to populate the Case Title on create if blank. However, I do not feel this is a proper solution as the workflow error will occur in any entities, and I am surely not feeling comfortable for creating such workflow in all entities.

I have reported this issue with Microsoft Support and was handled by Wipro - Support ref REG:116102094910228. The best solution they came up is ask the user to populate the Case Title, and not willing to escalate this issue to a more senior support team (or CRM development team for further investigation).

Would you agree that this is a bug in CRM workflow platform or is creating a workflow to populate the proper solution?

Regards,

Henri

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    PS Profile Picture
    23,577 on at

    I would not say its a bug. its the design of the system.

    Case Title is a Primary Field and its required to populate a case in any lookup. When the workflow searches for a regarding value. it could not find it and thats why this error.

    Solution provided to you by Wipro seems appropriate.

  • HenriL Profile Picture
    485 on at

    Thanks Prashant.

    The workflow simply checks if the Regarding contains a Case record or not. Technically, it should return true because the Regarding has a value regardless of the primary field containing value or not.

    Should the following step pointed by the blue arrow cause a run-time error at all? Currently, it does if the Case doesn't have a value in the Case Title.

    7587.Capture.PNG

    If a primary field must be populated then shouldn't this validation be enforced at the platform level, as currently the primary field of any entity may be changed to Optional.

    Also, if you read my previous point is that Case was created via Case Creation Rule. Therefore, using just out of the box features, a workflow created without custom code will produce a run-time error.

  • NatrajY Profile Picture
    3,040 on at

    It is a bug but MS won't fix it. Refer connect.microsoft.com/.../realtime-workflow-action-crash-display-name-if-condition-keynotfoundexception

  • Suggested answer
    Abed Haniyah Profile Picture
    4,287 on at

    Try to change the condition like this :

    If Regarding(Case)Case Number contain data then

    I met the same issue on a real time workflow on queue item and I changed the condition from Object (Email)Email to Object (Email) Sender Email and it was working fine :)

    0116.Capture.PNG

  • HenriL Profile Picture
    485 on at

    Thanks Natraj. I am glad that there are others whom have the same opinion. Just tried to access Connect, but could not find product named 'Dynamics CRM' or 'CRM'. Perhaps, they are in progress of renaming the product to 365.

    The site hasn't changed since I accessed it 3-4 years ago. Looks abandoned.

  • NatrajY Profile Picture
    3,040 on at

    Connect is still used for the "Microsoft Dynamics Preview & Feedback" program. If you are part of the preview program you should be able to access the link after signing in.

  • HenriL Profile Picture
    485 on at

    Thanks Abed.

    That may resolve the problem in this specific scenario because the Case Number is a system required field, if I am not mistaken. However, what about a custom entity as there is no system required field enforced by the platform.

    I guess the above solution is not addressing the inherent problem that a check condition in a workflow should not ever cause run-time error but return only either true or false, unless it is calling a custom workflow assembly.

    Thanks.

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 > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans