
Hi,
I have a custom table that has a field referencing the system Account table:
Table: Client Company
Name: ccc9_client_company
Field : Client Account
Name: ccc9_client_account
Data type: Unique Identifier
Field: Name
Name: ccc9_client_account_name
Data type: String
So, for each Account defined, there will be an entry in the Client Company table for the account.
Now, when a logged in user views a page, I want to show the Client Company details for the Account assigned to the current logged in user.
So far, I have tried a number of queries that all have not worked:
{% assign accountdetails = entities['account'][user.parentcustomerid.id] %}
{% fetchxml ccc9_client_company %}
<fetch mapping="logical" distinct="true">
<entity name="ccc9_client_company">
<all-attributes/>
<link-entity name="account" from="accountid" to="ccc9_client_account" visible="false" link-type="outer" alias="client_account_details_alias">
<all-attributes/>
</link-entity>
</entity>
</fetch>{% endfetchxml %}
{{ccc9_client_company.results['client_account_details_alias.ccc9_client_account_name']}}
The returned page is blank.
Any help / advise appreciated.
Thanks in advance,
For anyone new to this - I found a handy tool to help debug these queries - called XrmToolBox and then you have to add the FetchXmlTester and FetchXML Builder plugins.
With that I managed to generate the correct fetchxml.