locked
Pre-filtering in Fetch-based Reports, ms crm 2011 RRS feed

  • Question

  • Hi,

    I am using Fetch XML in my report and i wanted to implement Pre-Filtering.

    I have an entity by name "new_entityone" is linked with an another entity named "new_eventregistration".

    I have used the below code and seems like pre filtering is applied for only main entity ie. "new_entityone".

    How to enable pre-filtering for both parent entity and linked entity.?

    <fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="true">
      <entity name="new_entityone" enableprefiltering="1" prefilterparametername="FilteredEvent">    
        <attribute name="new_name" />    
        <attribute name="new_email" />
        <attribute name="createdon" />
        <order attribute="new_name" descending="false" />
        <link-entity name="new_eventregistration" from="new_entityoneid" to="new_entityoneid" alias="alianname" enableprefiltering="1" prefilterparametername="FilteredEventReg">
          <attribute name='new_total'/>
          <link-entity name="contact" from="contactid" to="new_registrantid" alias="contact">
    		<attribute name="lastname" />
    	  </link-entity>
        </link-entity>
      </entity>
    </fetch>
    
    While creating report , i have chosen Related Record Types = new_entityone,new_eventregistration.


    Thanks and Regards.

    Tuesday, October 7, 2014 7:20 AM

Answers

  • Hello,

    Just try to delete your existing report and create new.


    Dynamics CRM MVP/ Technical Evangelist at SlickData LLC
    My blog

    • Marked as answer by Ravitheja J Tuesday, October 7, 2014 5:18 PM
    Tuesday, October 7, 2014 4:37 PM
    Moderator

All replies

  • any help would be greatly appreciated

    Thanks and Regards.

    Tuesday, October 7, 2014 1:24 PM
  • Hello,

    I would suggest you to use following:

    1. Use other prefiltering style like:

    <fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="true">
      <entity name="new_entityone" enableprefiltering="1" prefilterparametername="CRM_Filterednew_entityone">    
        <attribute name="new_name" />    
        <attribute name="new_email" />
        <attribute name="createdon" />
        <order attribute="new_name" descending="false" />
        <link-entity name="new_eventregistration" from="new_entityoneid" to="new_entityoneid" alias="alianname" enableprefiltering="1" prefilterparametername="CRM_Filterednew_eventregistration">
          <attribute name='new_total'/>
          <link-entity name="contact" from="contactid" to="new_registrantid" alias="contact">
    		<attribute name="lastname" />
    	  </link-entity>
        </link-entity>
      </entity>
    </fetch>

    2. Prefiltering would not be turned on for related entity in case you are trying to update a report that during creation had only prefiltering for primary entity. So try to delete report and recreate it.


    Dynamics CRM MVP/ Technical Evangelist at SlickData LLC
    My blog

    Tuesday, October 7, 2014 3:47 PM
    Moderator
  • Hello,

    I would suggest you to use following:

    1. Use other prefiltering style like:

    <fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="true">
      <entity name="new_entityone" enableprefiltering="1" prefilterparametername="CRM_Filterednew_entityone">    
        <attribute name="new_name" />    
        <attribute name="new_email" />
        <attribute name="createdon" />
        <order attribute="new_name" descending="false" />
        <link-entity name="new_eventregistration" from="new_entityoneid" to="new_entityoneid" alias="alianname" enableprefiltering="1" prefilterparametername="CRM_Filterednew_eventregistration">
          <attribute name='new_total'/>
          <link-entity name="contact" from="contactid" to="new_registrantid" alias="contact">
    		<attribute name="lastname" />
    	  </link-entity>
        </link-entity>
      </entity>
    </fetch>

    2. Prefiltering would not be turned on for related entity in case you are trying to update a report that during creation had only prefiltering for primary entity. So try to delete report and recreate it.


    Dynamics CRM MVP/ Technical Evangelist at SlickData LLC
    My blog

    Hi Andrii,

    Thanks for the reply. I have checked with the above update code. event then, pre filtering is applied only for primary entity not to related entity.

    Could you please tell me how to turn on prefiltering for related entity while creating a report ?


    Thanks and Regards.


    • Edited by Ravitheja J Tuesday, October 7, 2014 4:21 PM
    Tuesday, October 7, 2014 4:15 PM
  • Hello,

    Just try to delete your existing report and create new.


    Dynamics CRM MVP/ Technical Evangelist at SlickData LLC
    My blog

    • Marked as answer by Ravitheja J Tuesday, October 7, 2014 5:18 PM
    Tuesday, October 7, 2014 4:37 PM
    Moderator