Skip to main content

Notifications

Customer experience | Sales, Customer Insights,...
Suggested answer

How to distinct fetchxml on subgrid

Posted on by 415

So, okay, here goes nothing.

 

I’m trying to display a subgrid on my custom new_project entity. This subgrid should show invoice attributes from invoices related to invoicedetails with which the new_projectid is related (we can invoice over multiple projects, each in his own invoicedetail).

If I create the desired system view, the disctinct="false" and there is an invoicedetailid attribute added (obviously I didn’t add that myself)! This can easily result in one invoice occurring 14 times in the subgrid.

So, I tried to set the distinct on true in the fetch and removed the invoicedetailid from it. Now I receive this pesty errormessage telling me that “Columns should always be specified on RetrieveMultiple”. That’s where my “mess up fetchxml”-skills are dried up. I tried to do the same using XRMToolbox’s FetchXML builder, but that won’t allow me to remove the invoicedetailid attribute.

 

Any thoughts?

 

Thanks,

Jeroen

  • Jeroen J Profile Picture
    Jeroen J 415 on at
    RE: How to distinct fetchxml on subgrid

    Hey Mike,

    thanks for getting back to me this fast.

    No, I haven't tried that, because it's very possible that there will be more than only 1 invoices that need to be displayed.

    Any other ideas maybe?

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to distinct fetchxml on subgrid

    Have you tried using a <fetch top="1" >

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans