cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
davespat73
Frequent Visitor

Filter XML query with linked entity not returning data

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,

1 ACCEPTED SOLUTION

Accepted Solutions
davespat73
Frequent Visitor

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.

 

 

View solution in original post

1 REPLY 1
davespat73
Frequent Visitor

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.

 

 

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Users online (1,332)