Skip to main content


 

Symptoms


How to update an EntityReference field in a CRM entity through a smartobject
 

Diagnoses


I have a smartobject that is generated from the CRM 2011 Account entity. Within this entity I have four custom reference fields to the User entity which I am attempting to update using a Picker control on a View in smartforms. I am able to search for the users and add them to the picker controls, however when I attempt to execute the Update method on the Account smartobject to save to CRM I get the following error: System.InvalidCastException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: _431B1523

Understandably this is a CRM error, so looking in the CRM error log the error is actually: Unable to cast object of type 'System.Guid' to type 'Microsoft.Xrm.Sdk.EntityReference'. What is the correct way then to update an entity reference field in a CRM smartobject?
 

Resolution

The ticket was linked to an existing tfs item and a coldfix was supplied by labs which resolved the issue.




 
Be the first to reply!

Reply