动态365,获取用fetchxml / c#的记录的所有者

发布于 2025-01-25 14:54:21 字数 334 浏览 1 评论 0原文

如何使用fetchxml或c#检索记录的所有者(例如任务)?

我可以将两个表任务和所有者与fetchxml联系起来:

<fetch>
  <entity name="task">
    <link-entity name="owner" from="ownerid" to="ownerid" />
  </entity>
</fetch>

但是我不确定如何进一步连接。我正在使用IS Systemuser进行测试的记录,我知道并猜测是联系人。但是ContactID的GUID在哪里?

How do I retrieve owner of a record (for example a task) with FetchXML or C#?

I can connect the two tables task and owner with FetchXML :

<fetch>
  <entity name="task">
    <link-entity name="owner" from="ownerid" to="ownerid" />
  </entity>
</fetch>

But I'm not sure how to connect further. The record I'm testing with is systemuser which I know and guess is contact. But where is the guid for contactid?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

写给空气的情书 2025-02-01 14:54:21

经过一堆Google搜索,我找到了答案。任务的所有者不能联系,而是Systemuser。因此,这是我创建以下代码的FetchXML,

这给了我任务拥有的系统用途者和团队的结果。

<fetch>
  <entity name="task">
    <attribute name="scheduledend" />
    <attribute name="subject" />
    <filter>
      <condition attribute="scheduledend" operator="le" value="2022.05.04" />
      <condition attribute="statecode" operator="eq" value="0" />
    </filter>
    <link-entity name="systemuser" from="systemuserid" to="ownerid" link-type="outer" alias="sysuser">
      <attribute name="internalemailaddress" />
    </link-entity>
    <link-entity name="team" from="teamid" to="ownerid" link-type="outer" alias="team">
      <attribute name="emailaddress" />
    </link-entity>
    <link-entity name="contact" from="contactid" to="regardingobjectid" link-type="outer" alias="contact">
      <attribute name="fullname" />
    </link-entity>
    <link-entity name="account" from="accountid" to="regardingobjectid" link-type="outer" alias="accout">
      <attribute name="name" />
    </link-entity>
  </entity>
</fetch>

After a bunch of google searches I found the answer. The owner of a task can't be contact, but systemuser. So this is the FetchXML I created

The following code gives me a result of systemusers and teams owned by tasks.

<fetch>
  <entity name="task">
    <attribute name="scheduledend" />
    <attribute name="subject" />
    <filter>
      <condition attribute="scheduledend" operator="le" value="2022.05.04" />
      <condition attribute="statecode" operator="eq" value="0" />
    </filter>
    <link-entity name="systemuser" from="systemuserid" to="ownerid" link-type="outer" alias="sysuser">
      <attribute name="internalemailaddress" />
    </link-entity>
    <link-entity name="team" from="teamid" to="ownerid" link-type="outer" alias="team">
      <attribute name="emailaddress" />
    </link-entity>
    <link-entity name="contact" from="contactid" to="regardingobjectid" link-type="outer" alias="contact">
      <attribute name="fullname" />
    </link-entity>
    <link-entity name="account" from="accountid" to="regardingobjectid" link-type="outer" alias="accout">
      <attribute name="name" />
    </link-entity>
  </entity>
</fetch>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文