Quantcast
Channel: Microsoft Dynamics CRM
Viewing all articles
Browse latest Browse all 154803

Forum Post: Unable to cast object of type 'System.Guid' to type 'Microsoft.Xrm.Sdk.EntityReference'

$
0
0
I have the following code OrganizationServiceProxy serviceProxy = GetOrganizationService(); Entity lead = new Entity("lead"); EntityReference accountLookup = new EntityReference { Id = accountId, LogicalName = "account" }; EntityReference ownerLookup = new EntityReference { Id = aePrimary, LogicalName = "systemuser" }; //lead.Attributes["parentaccountid"] = accountLookup; lead.Attributes["ds_aeprimary"] = aePrimary; lead.Attributes["ownerid"] = ownerLookup; lead.Attributes.Add("ds_projecttype", new OptionSetValue(projectType)); Guid response = serviceProxy.Create(lead); I am getting the Unable to cast object of type 'System.Guid' to type 'Microsoft.Xrm.Sdk.EntityReference' after upgrading sdk from 6 to 8. I went through article in this community and on google but nothing helped. Please help Thanks!

Viewing all articles
Browse latest Browse all 154803

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>