Hello community,
I have 3 tables.
Table 1 computers:
- Name (string)
- companyid (lookup 1:M table2)
- employeeid (lookup 1:M table3)
Table 2 companies:
- Name (string)
Table 3 employees:
- Name (string)
FetchXML is:
<fetch top="50" distinct="true" >
<entity name="cr847_table1" >
<attribute name="cr847_company" />
<attribute name="cr847_employe" />
<filter>
<condition attribute="cr847_tableid" operator="eq" value="640b201a-f939-eb11-a813-0022480691de" />
</filter>
</entity>
</fetch>
Result in FetchXML Builder are columns with GUID values like expected:
| Id | cr847_company | cr847_employe |
| 640b201a-f939-eb11-a813-0022480691de | 2c82dfe8-1fff-ea11-a815-000d3a98de0f | a690e432-8efd-ea11-a815-000d3a1021f8 |
Same FetchXML in FetchXML-Tester returns response:
<resultset morerecords="0">
<result>
<cr847_company name="Highfive" type="10902">{914557BB-0EFF-EA11-A815-000D3A98DE0F}</cr847_company>
<cr847_employe name="hero1" type="10903">{6BB332ED-1FFF-EA11-A815-000D3A1021F8}</cr847_employe>
</result>
</resultset>
Fine so far.
When I try to output this result in a webtemplate with Liquid:
{% fetchxml table1_query %}
# fetchxml from above
{% endfetch %}
{% for result in table1_query.results.entities %}
{{ result.cr847_company }}
{{ result.cr847_employe}}
{% endfor %}
nothing comes out.
Where is my mistake?
I think, everytime when FetchXML-Tester shows an additonal attribute like name or type in this example, I cannot use result.<attributname> for output.
Thanks for help,
AndKan.