Hi,
I'm having a hard time trying to get the aggr. values from the linked entity using the following code:
{% fetchxml cp_account %}
<fetch version="1.0" ouput-format="xml-platform" mapping="logical" aggregate="true">
<entity name="cr346_cp_account" >
<attribute name="cr346_debtor_no" alias="debtorno" groupby="true" />
<link-entity name="cr346_cp_balancehistory" from="cr346_primarycontact" to="cr346_primarycontact" link-type="inner" alias="balancehistory" visible="true" >
<attribute name="cr346_debtor_no" alias="debtornoBH" groupby="true" />
<attribute name="cr346_account_no" alias="accountnoBH" groupby="true" />
<attribute name="cr346_trans_amt" alias="transamount" aggregate="sum" />
<attribute name="cr346_balance_fwd" alias="balancefwd" aggregate="sum" />
<filter type="and" >
<condition attribute="cr346_primarycontact" operator="eq" value="{{user.id}}" uiname="{{user.fullname}}" uitype="contact" />
</filter>
</link-entity>
</entity>
</fetch>
{% endfetchxml %}
{% assign cp_balancehistory_results = cp_account.results.entities %}
<table>
<tr>
<th>Debtor Number</th>
<th>Account Number</th>
<th>Current Period Charges</th>
</tr>
{% for result in cp_balancehistory_results %}
<tr>
<td>{{ result.debtorno }}</td>
<td>{{ result['balancehistory.BHAccountNo.'] }}</td>
<td>{{ result['balancehistory.BHTransAmnt'] }}</td>
</tr>
{% endfor %}
</table>
No matter what I try it only shows the debtorno.
Any help will be appreciated.
Thanks,