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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested Answer

FetchXML Prefiltering Only Returning One Record in "Lists for related record types"

(0) ShareShare
ReportReport
Posted on by 60

I have used prefiltering many times with success, but all use cases are for running an SSRS report from a form with a single record. The single record produces the report flawlessly every time.

However, I would like to use the same simple report when selecting multiple records from a sub-grid, view or Advanced Find. However, I only get the first record. Anyone out there have a fix? Here's the query:

<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">
<entity name="rsmus_clinicalcasenote" enableprefiltering="1" prefilterparametername="CRM_FilteredCCN" >
<attribute name="rsmus_clinicalcasenoteid" />
<attribute name="rsmus_name" />
<attribute name="createdon" />
<attribute name="statuscode" />
<attribute name="statecode" />
<attribute name="overriddencreatedon" />
<attribute name="rsmus_priority_clinicalcasenote" />
<attribute name="ownerid" />
<attribute name="modifiedon" />
<attribute name="modifiedonbehalfby" />
<attribute name="modifiedby" />
<attribute name="rsmus_generalclinicalnote" />
<attribute name="rsmus_date" />
<attribute name="createdonbehalfby" />
<attribute name="createdby" />
<attribute name="rsmus_category_clinicalcasenote" />
<attribute name="rsmus_case" />
<order attribute="rsmus_name" descending="false" />
<order attribute="rsmus_case" descending="false" />
<order attribute="createdon" descending="true" />
<link-entity name="incident" from="incidentid" to="rsmus_case" link-type="inner" alias="Case" >
<attribute name="rsmus_client" />
<attribute name="ownerid" />
<attribute name="statecode" />
<attribute name="rsmus_programid" />
<attribute name="statuscode" />
</link-entity>
</entity>
</fetch>

And here are the two parameters. I have gone back and forth on using the CRM_FilterText (used it; abandoned it) with the same issue: only one record returned. 

Here is parameter CRM_FilteredCCN:

pastedimage1595582646370v1.png

Default Value here is:

<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false"><entity name="rsmus_clinicalcasenote"><all-attributes/></entity></fetch>

Here is the parameter CRM_FilterText:

pastedimage1595582732615v2.png

pastedimage1595582758859v3.png

And finally here is the incredibly simple report in design surface:

pastedimage1595582815824v4.png

Any help/advice will be much appreciated, 

Dan

I have the same question (0)
  • TBoswell Profile Picture
    on at

    Were you ever able to figure this out? I'm facing the same issue and haven't been able to pinpoint the issue.

  • Suggested answer
    Pawar Pravin Profile Picture
    5,237 on at

    Hi,

    Please try below solution:

    <link-entity name="incident" from="incidentid" to="rsmus_case" link-type="outer" alias="Case" >

    N.B.

    Just update link type relationship as outer and try to execute report once.

  • Suggested answer
    Mansoor Sulaiman Profile Picture
    4,330 on at

    Hi,

    Could you please add count in the fetchxml header as below?

    <fetch version="1.0" count='5000' output-format="xml-platform" mapping="logical" distinct="false">

       <entity name="abc_test" enableprefiltering="1">

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Hamza H Profile Picture

Hamza H 142 Super User 2026 Season 1

#2
Nagaraju_Matta Profile Picture

Nagaraju_Matta 128

#3
11manish Profile Picture

11manish 119

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans