web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Custom order report not displaying any data

(0) ShareShare
ReportReport
Posted on by

Hi,

I am trying to modify the existing Order report. Like the Order report I want to have it display the order that is currently being displayed on the form. Right now the report does not display any order. It was my understanding that the filtered views were content based but I don't seem to be retrieving any data.

Here is the fetchxml that I'm currently using...

<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">
  <entity name="salesorder"  enableprefiltering="true" prefilterparametername="FilteredSalesOrder">
    <attribute name="name" />
    <attribute name="totalamount" />
    <attribute name="statuscode" />
    <attribute name="customerid" />
    <attribute name="customeridtype" />
    <attribute name="createdon" />
    <attribute name="salesorderid" />
    <attribute name="totaltax" />
    <attribute name="totallineitemdiscountamount" />
    <attribute name="totallineitemamount" />
    <attribute name="totaldiscountamount" />
    <attribute name="totalamountlessfreight" />
    <attribute name="shipto_telephone" />
    <attribute name="shipto_stateorprovince" />
    <attribute name="shipto_postalcode" />
    <attribute name="shipto_name" />
    <attribute name="shipto_line3" />
    <attribute name="shipto_line2" />
    <attribute name="shipto_line1" />
    <attribute name="shipto_freighttermscode" />
    <attribute name="shipto_fax" />
    <attribute name="shipto_country" />
    <attribute name="shipto_city" />
    <attribute name="freightamount" />
    <attribute name="discountpercentage" />
    <attribute name="discountamount" />
    <attribute name="shippingmethodcode" />
    <attribute name="requestdeliveryby" />
    <attribute name="paymenttermscode" />
    <attribute name="ordernumber" />
    <attribute name="billto_stateorprovince" />
    <attribute name="billto_postalcode" />
    <attribute name="billto_name" />
    <attribute name="billto_line3" />
    <attribute name="billto_line2" />
    <attribute name="billto_line1" />
    <attribute name="billto_city" />
    <order attribute="name" descending="false" />
<filter type="and">
      <condition attribute="ordernumber" operator="eq" value="FilteredSalesOrder.salesorderid" />
    </filter>
    <link-entity name="contact" from="contactid" to="customerid" visible="false" link-type="outer" alias="salesorder_contact">
      <attribute name="emailaddress1" />
      <attribute name="fullname" />
      <attribute name="address1_postalcode" />
      <attribute name="address1_line3" />
      <attribute name="address1_line2" />
      <attribute name="address1_line1" />
      <attribute name="address1_stateorprovince" />
      <attribute name="address1_city" />
    </link-entity>
    <link-entity name="account" from="accountid" to="customerid" visible="false" link-type="outer" alias="salesorder_account">
      <attribute name="name" />
      <attribute name="address1_stateorprovince" />
      <attribute name="address1_postalcode" />
      <attribute name="address1_line3" />
      <attribute name="address1_line2" />
      <attribute name="address1_line1" />
      <attribute name="address1_city" />
    </link-entity>
    <link-entity name="systemuser" from="systemuserid" to="owninguser" visible="false" link-type="outer" alias="salesorder_systemuser">
      <attribute name="preferredphonecode" />
      <attribute name="personalemailaddress" />
      <attribute name="mobilephone" />
      <attribute name="homephone" />
      <attribute name="fullname" />
      <attribute name="address1_telephone2" />
      <attribute name="address1_telephone1" />
      <attribute name="address1_postalcode" />
      <attribute name="address1_line3" />
      <attribute name="address1_line2" />
      <attribute name="address1_line1" />
      <attribute name="address1_stateorprovince" />
      <attribute name="address1_city" />
    </link-entity>
  </entity>
</fetch>


Thank you for the help!!

Gary

*This post is locked for comments

I have the same question (0)
  • NatrajY Profile Picture
    3,040 on at
    RE: Custom order report not displaying any data

    If this is the case, the first confirm the fetchxml produces any data. Remove the pre-filtering stuff from the query and plugin the orderid directly into FilteredSalesOrder.salesorderid. Then use FetchXML Tester in XrmToolbox or CRM DevTools from Sonoma Partners to run the fetchxml and have a look at the results, using the credentials of the target user. Once you confirm that results are returned, you can proceed to troubleshoot this issue further.

  • Community Member Profile Picture
    on at
    RE: Custom order report not displaying any data

    HI Natraj,

    Thank you for the response!! There was an error in the condition which I have corrected. After making the correction I was able to retrieve data using XrmToolBox. I then added the prefiltering attributes back in. When I try to preview the report I get an "Invalid Argument", when I upload and run the report within the order form I get "Cannot read the next datarow for the dataset Dataset1".

    The original report was using a parameter called QuoteId which had the salesorderid for the record being displayed. The problem is that when you download the report it has a specific value in it, even when you download it from the Reports and not from the form.

    Gary

  • Aileen Gusni Profile Picture
    44,524 on at
    RE: Custom order report not displaying any data

    Hi have you set the related entity is Order?

  • Community Member Profile Picture
    on at
    RE: Custom order report not displaying any data

    Hi Aileen,

    Yes I have set the related record type to order.

    Gary

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
HR-09070029-0 Profile Picture

HR-09070029-0 2

#1
UllrSki Profile Picture

UllrSki 2

#3
ED-30091530-0 Profile Picture

ED-30091530-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans