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