What am I doing wrong with this fetchxml report?

Răspuns What am I doing wrong with this fetchxml report?

  • Tuesday, July 24, 2012 12:37 PM
     
      Has Code

    Hello Im new in CRM 2011,
     
    I have two dataset under report invoice when I put enableprefiltering='1' in the tow dataset the report does not work by cons when I use a filter as follows :
     
     <filter type="and"/>
           <condition attribute="invoiceid" operator="eq" value="@CRM_QuoteId" />
         </filter/>
     
      the report runs but only for one invoice (the top one) but not the rest even if I have the option to turn the report for the selected invoice.
     
      Need help please!!
     
      here are my queries :
     
      for dataset1:
      
      
    <fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false" count="1">
      <entity name='invoice' enableprefiltering='1' prefilterparametername='CRM_QuoteId'>
       
     <attribute name="name"/>
       <attribute name="totalamount" />
       <attribute name="customeridname" />
       <attribute name="invoiceid" />
       <attribute name="shipto_city" />
       <attribute name="shipto_country" />
       <attribute name="shipto_fax" />
       <attribute name="shipto_freighttermscode" />
       <attribute name="shipto_line1" />
       <attribute name="shipto_line2" />
       <attribute name="shipto_line3" />
       <attribute name="shipto_name" />
       <attribute name="shipto_postalcode" />
       <attribute name="shipto_stateorprovince" />
       <attribute name="shipto_telephone" />
       <attribute name="discountpercentage" />
       <attribute name="discountamount" />
       <attribute name="totallineitemdiscountamount" />
       <attribute name="totallineitemamount" />
       <attribute name="totaldiscountamount" />
       <attribute name="totalamountlessfreight" />
       <attribute name="totaltax" />
       <attribute name="freightamount" />
       <attribute name="customeridtype" />
       <attribute name="customerid" />
       <attribute name="billto_city" />
       <attribute name="billto_line1" />
       <attribute name="billto_line2" />
       <attribute name="billto_line3" />
       <attribute name="billto_name" />
       <attribute name="billto_postalcode" />
       <attribute name="billto_stateorprovince" />
       <attribute name="invoicenumber" />
       <attribute name="paymenttermscode" />
       <attribute name="shippingmethodcode" />
       <link-entity name="contact" from="contactid" to="customerid" link-type="outer" alias="C">
        <attribute name="fullname" />
        <attribute name="address1_line1" />
        <attribute name="address1_line2" />
        <attribute name="address1_line3" />
        <attribute name="address1_postalcode" />
        <attribute name="address1_city" />
        <attribute name="address1_stateorprovince" />
       </link-entity>
       <link-entity name="account" from="accountid" to="customerid" link-type="outer" alias="A">
        <attribute name="name" />
        <attribute name="address1_line1" />
        <attribute name="address1_line2" />
        <attribute name="address1_line3" />
        <attribute name="address1_postalcode" />
        <attribute name="address1_city" />
        <attribute name="address1_stateorprovince" />
       </link-entity>
       <link-entity name="systemuser" from="systemuserid" to="ownerid" link-type="outer" alias="O">
        <attribute name="address1_city" />
        <attribute name="address1_line1" />
        <attribute name="address1_line2" />
        <attribute name="address1_line3" />
        <attribute name="address1_postalcode" />
        <attribute name="address1_stateorprovince" />
        <attribute name="address1_telephone1" />
        <attribute name="fullname" />
        <attribute name="personalemailaddress" />
       </link-entity>
      </entity>
     </fetch>


     
    for dataset2:
     
    <fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">
      <entity name='invoicedetail' enableprefiltering='1' prefilterparametername='CRM_QuoteId' >
      
       <attribute name='baseamount' />
       <attribute name='extendedamount' />
       <attribute name='invoicedetailid' />
       <attribute name='invoiceid' />
       <attribute name='lineitemnumber' />
       <attribute name='priceperunit' />
       <attribute name='productdescription' />
       <attribute name='productidname' />
       <attribute name='quantity' />
       <attribute name='tax' />
       <attribute name='uomidname' />
       <attribute name='volumediscountamount' />
       <attribute name='manualdiscountamount' />
       <link-entity name='product' from='productid' to='productid' link-type='outer' alias="P">
       <attribute name='productnumber' />
       <attribute name='name' />
       </link-entity>
      </entity>
     </fetch>


     
    any idea ??

All Replies

  • Tuesday, July 24, 2012 12:57 PM
     
     

    I did not understand the question but it should work without the parameter as 

    enableprefiltering='1 should take care of filtering.


    If you find this post helpful then please "Vote as Helpful" and "Mark As Answer". Amreek Singh Senior CRM Consultant CDC Praxa Sydney, Australia http://mscrmshop.blogspot.com http://crm2011usersettings.codeplex.com

  • Tuesday, July 24, 2012 1:05 PM
     
     

    Hello,

    Thanks for your reply.

    The probleme is that the report wont work when i use enableprefiltering for the both dataset, but when i use feltring condition like :

    <filter type="and"/>
           <condition attribute="invoiceid" operator="eq" value="@CRM_QuoteId" />
         </filter/>

    the repot run just for the top invoice not for the selected invoice ???

  • Tuesday, July 24, 2012 1:32 PM
     
     Answered
    How are you deploying this report in crm?

    If you find this post helpful then please "Vote as Helpful" and "Mark As Answer". Amreek Singh Senior CRM Consultant CDC Praxa Sydney, Australia http://mscrmshop.blogspot.com http://crm2011usersettings.codeplex.com

    • Marked As Answer by Ussamoo Wednesday, July 25, 2012 11:44 PM
    •  
  • Tuesday, July 24, 2012 1:36 PM
     
     

    I have a report and subreport, so i created tow report with existing rdl file