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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Unanswered

Custom control: setFilter() and refresh() do not work when first result has only a single page.

(0) ShareShare
ReportReport
Posted on by 5

Hi,

I am creating a PCF control that can be used to visualize a list of activities. It's important this control visualizes quickly, so as an optimization I want to add a filter on the dataset which only retrieves recent records. When this dataset is loaded and the user can click, I remove the filter and all records are loaded in the background, allowing the user to start working (assuming the already loaded records are what the user wants to view).

Basically, the control works as follows:

- init, setFilter with date > 14 ago and date < next 14 days,

- updateView, first page of results, updates the visible data 

- updateView, next page (if applicable) 

    ...

- In the last updateView when all pages are loaded, the filter is removed, and the dataset is refreshed using context.parameters.dataSet.refresh().

- updateView, first page of results, updates all data (since no filtering is applied).

- updateView, next page (if applicable)

    ... etc.

This works like a charm if the initial result has multiple pages. 

However, when I try to refresh a dataset which has only one page, the new filter (which should return all records) is never applied and exactly the same records are returned after the refresh().

Am I doing something wrong? I tried clearing the filter before setting it, resetting the paging, changing the page size, but nothing seems to trigger an update for the record set if the initial one is only one page.

Kind regards, 

Maarten van Sambeek

I have the same question (0)
  • Thomas David Dayman Profile Picture
    11,323 on at

    Bringing this post back from the dead. I am also getting this issue as well. I am doing some advanced filtering and sorting on my fetchxml for the dataset view. When it first loads the data on my pcf the filter works like a charm. But if I hit refresh then the filter removes itself, until I reload the whole page again.

    Anyone else have a solution to this?

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 170 Super User 2025 Season 2

#2
#ManoVerse Profile Picture

#ManoVerse 70

#3
Jimmy Passeti Profile Picture

Jimmy Passeti 50 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans