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!
↧
Forum Post: Unable to cast object of type 'System.Guid' to type 'Microsoft.Xrm.Sdk.EntityReference'
↧