Hello,
I am trying to make a report in CRM but am having difficulties linking entities and getting the data grouped correctly. I need to create a report where all invoice products are pulled from CRM and then grouped by productID so i can aggregate how many of each product have been sold. This then needs to be filtered by account so I can see which products are popular with who. My fetch xml is as follows
<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false"><entity name="invoicedetail"><attribute name="productid" /> <attribute name="productdescription" /> <attribute name="priceperunit" /> <attribute name="quantity" /> <attribute name="extendedamount" /> <attribute name="invoicedetailid" /> <filter type="and"><condition attribute="quantity" operator="gt" value="0" /> </filter><order attribute="productid" descending="false" /> <link-entity name="invoice" from="invoiceid" to="invoiceid" alias="aa"><link-entity name="account" from="accountid" to="customerid" alias="ab" /> </link-entity></entity></fetch>
I'm not sure quite on how too go about the groupings and linking the entities together in Visual Studio, as I am pretty new to it all.
if anyone knows a good resource that could help me with this I would be very grateful.