【问题标题】:How can I retrieve two entities that are associated with a connection entity, only under the name record2roleid?如何检索与连接实体关联的两个实体,仅在名称 record2roleid 下?
【发布时间】:2019-11-08 21:34:55
【问题描述】:

我有一个连接,该连接使用角色名称 [record2roleid] 连接到两个实体“workorder”和“object”。

如果两个实体就在属性名 [record2roleid] 下,我如何检查它们之间的连接?

【问题讨论】:

  • 向我们展示你的尝试,至少一些 SQL 等价于转换成 linq..
  • var connections = from c in ServiceContext.CreateQuery("connection") where c.GetAttributeValue("record2roleid").Name.Equals("x") select c;

标签: linq dynamics-crm crm dynamics-365


【解决方案1】:

试试这个方法

<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">
  <entity name="connection">
    <attribute name="record2id" />
    <attribute name="record2roleid" />
    <attribute name="connectionid" />
    <attribute name="record2objecttypecode" />
    <attribute name="record1objecttypecode" />
    <attribute name="record1roleid" />
    <attribute name="name" />
    <attribute name="record1id" />

    <link-entity name="connectionrole" from="connectionroleid" to="record2roleid" link-type="inner" alias="ad">
      <filter type="and">
        <condition attribute="name" operator="like" value="%Part%" />
      </filter>
    </link-entity>
  </entity>
</fetch

【讨论】:

  • 谢谢,我已经找到了解决方案,但我稍后会尝试您的解决方案,因为我也想学习 Fetch-Xml。:) 再次感谢!
猜你喜欢
  • 1970-01-01
  • 2015-05-31
  • 1970-01-01
  • 1970-01-01
  • 2016-07-12
  • 1970-01-01
  • 1970-01-01
  • 2017-09-02
  • 2015-06-04
相关资源
最近更新 更多