You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

基于联系人主账户及关联连接筛选内置列表的实现方法

筛选关联主账户及多连接账户的项目

核心逻辑

要筛选的项目需满足以下任一条件:

  • 项目所属的Account等于当前联系人的主账户(即默认的Contact.AccountId字段)
  • 项目所属的Account与当前联系人存在Connection关联(需匹配Connection的实体类型)

具体实现方式

1. 高级查找(快速配置场景)

在项目列表的高级查找中设置筛选规则:

  • 第一组条件:Company Name(项目关联的Account字段) 等于 当前登录联系人的主账户
  • 添加或组条件:
    • 关联实体选择Connections,依次设置:
      • Connected From 等于 当前登录联系人
      • Connected To 等于 项目的Company Name
      • (可选)指定Connection Type为你配置的联系人-账户关联类型(比如“关联合作账户”)

2. FetchXML 筛选(自定义报表/代码场景)

核心查询结构如下(替换成你的项目实体名称,比如opportunity/case):

<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="true">
  <entity name="incident">
    <attribute name="title" />
    <attribute name="accountid" />
    <filter type="or">
      <!-- 匹配主账户 -->
      <condition attribute="accountid" operator="eq" value="@currentContactAccountId" />
      <!-- 匹配Connections关联的账户 -->
      <link-entity name="connection" from="record1id" to="accountid" link-type="inner" alias="conn">
        <filter type="and">
          <condition attribute="record1objecttypecode" operator="eq" value="account" />
          <condition attribute="record2id" operator="eq" value="@currentContactId" />
          <condition attribute="record2objecttypecode" operator="eq" value="contact" />
          <!-- 可选:指定连接类型ID -->
          <condition attribute="connectiontypecode" operator="eq" value="你的连接类型ID" />
        </filter>
      </link-entity>
    </filter>
  </entity>
</fetch>

其中@currentContactAccountId为当前登录联系人的主账户ID,@currentContactId为当前联系人ID。

3. Power Apps 画布应用筛选公式

如果是在Power Apps的项目列表中,使用以下公式:

Filter(
    项目实体,
    Account.Id = 当前联系人.Account.Id ||
    Account.Id in (
        Filter(
            Connections,
            Record2.Id = 当前联系人.Id &&
            Record2.EntityType = "contact" &&
            Record1.EntityType = "account" &&
            ConnectionType = "你的连接类型名称"
        ).Record1.Id
    )
)

注意事项

  • 确认Connections的实体方向:根据你的配置,可能是Record1为账户、Record2为联系人,需对应调整筛选条件
  • 务必添加连接类型筛选,避免无关连接干扰结果
  • 开启去重设置(FetchXML中的distinct="true"、高级查找中的“重复值”过滤),防止同一项目重复显示

内容的提问来源于stack exchange,提问作者HelpAStudentOut

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.14 08:27:10