用Liquid过滤EntityList

问题描述

作为临时列表和实体列表的新手,我将其视为等效于select * from vehiclesql,并试图找出如何添加where子句来制作select * from vehicle where keeper = {{userid}}并在我的生命中,我找不到该怎么做。

有没有简单的方法来应用简单的过滤器?

    {% entitylist name:"Vehicle" %}
      {% entityview %}
        <p>Found {{ entityview.total_records }} records</p>
        <table class="table">
          <tbody>
            {% for e in entityview.records -%}
              <tr>
                <td>
                    <p>Keeper <strong>{{ e.keeper }}</strong></p>
                    <p>Name <strong>{{ e.vehiclemake }}</strong></p>
                    <p>Fuel Card <strong>{{ e.vehiclemodel }}</strong></p>
                    <p>VRM <strong>{{ e.vehicleregistration }}</strong></p>
                </td>
              <tr>
            {% endfor -%}
          </tbody>
        </table>
      {% endentityview %}
    {% endentitylist %}

在Arun答案的链接中,建议按当前登录用户过滤实体列表,这似乎是显而易见的,但是当我转到列表时,尝试这样做,我不会添加联系人(parentcontactid)

的选项

enter image description here

解决方法

使用门户网站用户/父联系人属性配置甚至液体模板中的fetchxml标记,可以使用多种方法来过滤门户网站中的实体列表。

The trick from Nick是另一种无代码配置的解决方案。

基本上,我们可以创建一个虚拟联系人,使用它来过滤视图并让门户网站引擎在运行时替换当前的门户网站用户。

enter image description here