Filtering Entities with type Entity Reference?

前端 未结 3 817
旧时难觅i
旧时难觅i 2021-01-26 11:30

How do I query using the string value for an entity reference object?

QueryExpression query = new QueryExpression(\"entityName\");
query.Criteria = new FilterExp         


        
3条回答
  •  温柔的废话
    2021-01-26 11:45

    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");
    

提交回复
热议问题