When you create a new entity, one of the fields that is generally left unchanged is the primary field for the entity. It is usually “[publisherprefix]_name”.
What is the bug?
If the value of the primary field is null on a parent entity, any child entity can’t use “if condition” on the parent relationship field. It would result in a “KeyNotFound” exception.
- Create an entity that will be the parent entity
- Create an entity that will be the child. Create a relationship to the parent entity
- Make the primary field on the parent entity as optional
- Create a new realtime workflow on the child entity, with a condition statement that refers the parent lookup field in the child entity
- Create a parent record without the name field set
- Create a child record that has the parent lookup set the record created in the previous step. The parent lookup will be displayed as “no name” as the primary field for the parent entity is not set.
- Execute the realtime workflow against the child record in the previous step. A “The given key was not present in the dictionary” exception will be displayed
The issue is happening both in CRM 2015 and CRMOnline on version 220.127.116.112. This issue seems to be only affecting realtime workflows and actions, and not background workflows.
EDIT (24/06/2016): Issue logged on Connect -> https://connect.microsoft.com/site687/feedback/details/2851391/realtime-workflow-action-crash-display-name-if-condition-keynotfoundexception