Hello,
I'm implementing a custom DataSet control for Dynamics and I've run into an unexpected behavior while paging using the loadExactPage method (as advised in
).
The method works fine until I refresh the DataSet (using a ribbon button/dataSet.refresh method). After that, the updateView method is being invoked infinitely with loading property set to true while navigating to the third (and - in my particular case - last) page.
Does anybody have the same experience?
Thank you very much.
I'm currently having the same issue when loading the 3rd page. updateView is being called continuously in some infinite recursion of loadExactPage. The view keeps flipping between the 2nd and 3rd pages. Did you find the issue or a workaround?
Hello Scott,
I've always used the component on a form subgrid. I honestly haven't tried it elsewhere and unfortunately threw away my minimum repro, so I can't confirm that it's a problem specific for subgrids ☹️
Actually - I've reproduced this without using addColumn - but only on a form subgrid - it doesn't seem to happen on a home grid view - are you seeing it on a form subgrid?
BTW - are you using addColumn? I've seen similar behaviour when adding a column to the dataset, using setExactPage and in a form subgrid.
It seems that the control gets into an infinite loop.
In Model using loadNextPage will add records to the dataset but loadPreviousPage will not remove any - you will still have all records loaded up until that point. hasPreviousPage will always be false unless you start off at a page>1 to start with.
In Canvas - it works differently - more like you would expect paging to work with next/previous.
I recently blogged on this subject - https://community.dynamics.com/crm/b/develop1/posts/pcf-dataset-paging-in-model-vs-canvas-apps
It outlines the differences between Canvas and Model with paging.
Hope this helps!
Hello @sheldoncopper73,
I'm sorry for belated answer. I haven't experienced that exact issue you have run into. I use the latest version of PCF and loadExactPage method (not loadPreviousPage method). A workaround I currently use is caching a loaded set of records in memory and displaying only a relevant subset. Not optimal, though.
Hello @AnqiChen, thank you for your answer. I will give it a try.
hi team,
1) Once one click 'Refresh', it will goes back to first data page.
The thing is that how does control know that it is at 'first' page.
Then check context.parameter.{dataset propertykey}.paging.firstpagenumber/lastpagenumber
If they are the same, and then the control knows where it is
We have the code change some time in March, some area might get it released, might might still wait one or two weeks. Not very long
2) loadExactPage needs to be accept 'number'
Apart from the issue which you mentioned we are still facing one issue using paging i.e
Suppose we have 250 records with paging size of 50.
When form first page we click on next i.e. Page 2 then next page 50 record are loaded properly but when I again click on previous page button i.e from Page 2 to Page 1 then it should 50 records of page 1 but currently it is loading 100 records i.e. Page 2 + Page 1 records.
Could you check from your end if you also face this issue.
Look forward to your reply.
WarrenBelz
87
Most Valuable Professional
mmbr1606
71
Super User 2025 Season 1
Michael E. Gernaey
65
Super User 2025 Season 1