Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 82002

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

$
0
0

QueryExpression query = new QueryExpression();
query.EntityName = "product";
query.ColumnSet.AllColumns = true;
query.Criteria = new FilterExpression();
query.Criteria.FilterOperator = LogicalOperator.And;
query.Criteria.Conditions.Add
(
new ConditionExpression("new_idproduct", ConditionOperator.Equal, document.Element("prestashop").Element("order").Element("associations").Element("order_rows").Elements().ElementAt(f).Element("product_id").Value)
);
EntityCollection entities = service.RetrieveMultiple(query);
if (entities.Entities.Count > 0) {
if (entitiespr[0].GetAttributeValue<EntityReference>("productid").Id.Equals(entities[0].Id))
{
f++;
}
}


Viewing all articles
Browse latest Browse all 82002

Trending Articles



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