How do I query using the string value for an entity reference object?
QueryExpression query = new QueryExpression(\"entityName\");
query.Criteria = new FilterExp
You need to filter on the name
attribute of the associated account
entity.
Join the account
entity to the opportunity
entity and apply a ConditionExpression
to it like this:
var query = new QueryExpression("opportunity");
LinkEntity link = query.AddLink("account", "parentaccountid", "accountid");
link.AddCondition("name", ConditionOperator.BeginsWith, "14");