Query regarding pagination in Interface

Certified Senior Developer

Hi, 

I have a large number of records in database and I'm fetching that using queryEntity() function and showing it in a gridField(). I have given pagingInfo() detail in queryEntity() like 

a!pagingInfo( startIndex: 1, batchSize: - 1)  and in gridField() like  a!pagingInfo( startIndex: 1, batchSize: 50). Now I want know that does Appian fetch all the records from database in one go or not? If so, I want to  search records in the batch size of 50, so that, when I click next button in the pagign the next 50 records will be fetched from database. How could I do that?

  Discussion posts and replies are publicly visible

Parents
  • Hi Sudipdas,

    It depends how you design you interface i.e. either you want to call the data from database or just bunch of data from database.
    But it would be best practice to fetch of bunch of data from the database and again fetch batch of data from the database when user click on next button.

    to implement your requirement, you need two things :

    1- > queryentity : it will return you 50 records each time . It will have one rule input pagingInfo .

    2 - > Main interface : your grid . Here you need to use with() and within with you need to call your queryentity with the pagingInfo . So everytime you will click on next button only 50 records will fetched from database.

    I hope this will you give the way to implement your requirement.

    Regards
    Abhay
Reply
  • Hi Sudipdas,

    It depends how you design you interface i.e. either you want to call the data from database or just bunch of data from database.
    But it would be best practice to fetch of bunch of data from the database and again fetch batch of data from the database when user click on next button.

    to implement your requirement, you need two things :

    1- > queryentity : it will return you 50 records each time . It will have one rule input pagingInfo .

    2 - > Main interface : your grid . Here you need to use with() and within with you need to call your queryentity with the pagingInfo . So everytime you will click on next button only 50 records will fetched from database.

    I hope this will you give the way to implement your requirement.

    Regards
    Abhay
Children
No Data