locked
BID and Custom Report based on opened entity form RRS feed

  • Question

  • Hi

    I have created a report in BID with the following fetch-query :

    <fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">
      <entity name="invoice">
        <attribute name="name" />
        <attribute name="customerid" />
        <attribute name="statuscode" />
        <attribute name="totalamount" />
        <attribute name="invoiceid" />
        <order attribute="name" descending="false" />
    <filter type="and">
          <condition attribute="invoiceid" operator="eq" value="@invoiceid" />
        </filter>
      </entity>
    </fetch>

    And here is the configuration for report dataset :

    But When I want to use it in opened form of some invoice,

    it does not load the invoice data and wants me to  suply invoice id as below :

    I want it to load invoice automatically without asking the id.

    Monday, February 9, 2015 11:48 AM

Answers

All replies

  • Hello,

    You should use prefiltering. Recheck following article - https://slalomdotcom.wordpress.com/2011/10/24/dynamics-crm-2011-report-development-using-fetchxml/


    Dynamics CRM MVP/ Technical Evangelist at SlickData LLC
    My blog

    Monday, February 9, 2015 12:13 PM
    Moderator
  • Refer this. You just need to enable prefiltering.

    Regards, Saad

    Monday, February 9, 2015 12:16 PM
  • Thanks a lot it works ok , but I have another question.

    The report is shown without any problem but sub-report is not begin shown and seems empty. here is the fetchxml for sub-report:

    <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" />
        <order attribute="productid" descending="false" />
         <link-entity name="invoice" from="invoiceid" to="invoiceid" alias="aa">
          <filter type="and">
            <condition attribute="invoicenumber" operator="eq" value="@myinvid" />
          </filter>
        </link-entity>
      </entity>
    </fetch>
    I run the sub report by sending invoice id manually and it worked!

    Monday, February 9, 2015 7:55 PM
  • Hello,

    What do you pass to @myenvid parameter from parent report? Invoice number or invoiceid?


    Dynamics CRM MVP/ Technical Evangelist at SlickData LLC
    My blog

    Tuesday, February 10, 2015 4:22 AM
    Moderator
  • Here is how I configure it and how I arrange subreport on parent report 

    Tuesday, February 10, 2015 8:57 AM
  • Could you please provide screenshot that shows how you map report parameter to dataset parameter in your child report.

    Dynamics CRM MVP/ Technical Evangelist at SlickData LLC
    My blog

    Tuesday, February 10, 2015 9:16 AM
    Moderator
  • I changed sub-report query to the follwowing one and it seems working :

    <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" />
        <order attribute="productid" descending="false" />
         <link-entity name="invoice" from="invoiceid" to="invoiceid" alias="aa" prefilterparametername="invid">
        
        </link-entity>
      </entity>
    </fetch>

    Tuesday, February 10, 2015 9:37 AM
  • I changed sub-report query to the follwowing one and it seems working :

    <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" />
        <order attribute="productid" descending="false" />
         <link-entity name="invoice" from="invoiceid" to="invoiceid" alias="aa" prefilterparametername="invid">
        
        </link-entity>
      </entity>
    </fetch>

    That would not work. To make it work you should use fetch query like following for child report:

    <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="invoiceid" operator="eq" value="@invid" />
          </filter>
        <order attribute="productid" descending="false" />
      </entity>
    </fetch>


    Dynamics CRM MVP/ Technical Evangelist at SlickData LLC
    My blog

    Tuesday, February 10, 2015 9:54 AM
    Moderator
  • Yes you were right . It works now
    Thursday, February 12, 2015 7:52 AM