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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / loadNextPage() functio...
Power Apps
Unanswered

loadNextPage() function throwing error

(1) ShareShare
ReportReport
Posted on by 10

Hi,

 

We created dataset control in that to get to load all record in context faster we write below code. It working fine till yesterday but now we are getting error message on line of loadNextPage().

 

// code

if (!this._context.parameters.sampleDataSet.loading) {
 if (plotLib.isValid(this._context.parameters.sampleDataSet.paging.hasNextPage) && this._context.parameters.sampleDataSet.paging.hasNextPage == true) {
                    //set page size
                     this._context.parameters.sampleDataSet.paging.setPageSize(5000);
                    //load next paging
                    this._context.parameters.sampleDataSet.paging.loadNextPage();
                }
            }
//Error

loadControl ModernQueryBuilder: getState function not provided.

 

We remove the setPageSize() line of code then it not giving error but it slow down the speed of control.

 

suggest something to resolve this issue.

 

Thanks

I have the same question (0)
  • Diana Birkelbach Profile Picture
    3,072 Most Valuable Professional on at

    Hi @PCFDeveloper03 , 

     

    I suppose the code you've posted is in updateView or triggered from there.

    What if you call the paging.setPageSize(5000) in your init method? 

     

    Kind regards,

    Diana

  • PCFDeveloper03 Profile Picture
    10 on at

    Hi Diana,

     

    As per your suggestion I added setPageSize(5000) in init method then also same error is throwing at my end.

     

    Can you provide some sample code if same thing works at your end.

     

    Thanks!

  • Diana Birkelbach Profile Picture
    3,072 Most Valuable Professional on at

    Hi @PCFDeveloper03 , 

     

    In my use case, I show the data in a calendar. Not sure if it's the best approach, but I use the init to set 

    context.parameters.dataset.paging.setPageSize(0);

    and when the month is changed in my calendar, I retrieve the data:

    dataset.filtering.setFilter(...); //I set the filter on my current month 
    dataset.paging.setPageSize(5000); 
    dataset.refresh(); 

     

    Not exactly the same use case, but I should have the same problems like you. It still works for me.

    Maybe there was an update that I've didn't got already.

     

    Maybe you can investigate this:

     - I think you need a dataset.refresh() after you change the paging size.

    - Do you change the filter of your dataset? Can you comment that?

    - Maybe there weren't so many records in your entity a few days ago, and that's why you didn't get the error until now? 

    - Can you track the requests in the Network Protocol? Maybe you get to see there, what is the fetchXml that is actually been used and what's the response there?

     

    Hope it helps to find the problem.

    Kind regards,

    Diana

  • PCFDeveloper03 Profile Picture
    10 on at

    Hi Diana,

     

    As per your suggestion I added dataset.refresh() after change the paging size then also we get same error.

     

    we did not change any filter of dataset.

     

    previously also we check our control for 20k record and it's working fine at that time.

     

    Thanks!

  • Diana Birkelbach Profile Picture
    3,072 Most Valuable Professional on at

    Hi @PCFDeveloper03 , 

     

    Given the error reported in the other thread (https://powerusers.microsoft.com/t5/Power-Apps-Pro-Dev-ISV/Facing-issue-bug-while-using-AddColumns/m-p/736729#M3538) ( not exactly the same, but similar; and stopped working a few days ago), I suppose it's a problem with the platform. I hope the product team can help us soon.

     

    Kind regards,

    Diana

  • Hemant Gaur Profile Picture
    on at

    Ack .. seems this is a separate bug. We are looking into it. 

    Will update the thread once I have more information .

     

    hemant 

  • PCFDeveloper03 Profile Picture
    10 on at

    Hi Hemant,

     

    Thanks for your reply.

     

    Please let us know once it resolve.

     

    Waiting for your reply.

     

    Thanks

  • PCFDeveloper03 Profile Picture
    10 on at

    Hi Hemant,

     

    We are still getting this error.

     

    Could you please let me know if this issue resolve or not.

     

    Waiting for your reply.

     

    Thanks.

  • ybelkouchi07 Profile Picture
    33 on at

    I'm facing the same problem for a while too.

  • ybelkouchi07 Profile Picture
    33 on at

     

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard