Reputation: 67
I need to extract a single value from entity. It is sort of a global setting and it doesn't have relationships with a calling entity. But when I try to do it with RetrieveMultiple
I get an empty response.
string name="objectToRetrieve";
QueryExpression qe = new QueryExpression { EntityName = "new_setting", ColumnSet =new ColumnSet ("new_name","new_value")};
qe.Criteria.AddCondition("new_name", ConditionOperator.Equal, name);
EntityCollection response = service.RetrieveMultiple(qe);
When I retrieve it by Guid
everything works fine.
Entity response = service.Retreve("new_setting", Guid.Parse("09BF9644-9BBA-E511-80FA-005056924035), new ColumnSet("new_value"));
How do I get it without Guid
?
Upvotes: 0
Views: 1021
Reputation: 18895
Your retrieve multiple is setup correctly. So there are a couple options that could be happening...
Your code is correct, you'll have to think through what assumption you've made that is not true. I'd first make sure that the GUID of the entity being returned matches what you're expecting.
Upvotes: 1