Save Time! Now get all the records of Dataset Grid control Swiftly

By | September 17, 2019


With the help of PCF (PowerApps Component Framework) Control, we design control for Dataset Grid, which we can add on any OOB and custom entity to show records that are available in the selected view. We show data for the available set of columns that are added in the selected view. To show all records data in Dataset Grid control, first, we need to load all records in Dataset Context property (context.parameters.sampleDataSet).


Recently we developed a PCF Control for Dataset where we have shown all the records of selected view on one page. But for a large set of records it takes a long time to load because at a time we are able to load only the count of records that are set in settings of Dynamics 365 CRM as shown below:



To overcome this hurdle, we used loadNextPage() method of Paging to load all the records of dataset as illustrated below:


Using loadNextPage() method, we successfully loaded all the records of selected view in Dataset Context property (context.parameters.sampleDataSet). But when there were large number of records it took a long time to load all the records. This led us to find an alternative to load all the records in lesser time. We found the setPageSize() method of Paging, where we can set the page size of Dataset Context property (context.parameters.sampleDataSet) as mentioned below:


To load all the records of selected view in Dataset Grid control it is necessary to make some changes in updateView() function as shown below:

 public updateView(context: ComponentFramework.Context<IInputs>): void {

if (!context.parameters.sampleDataSet.loading) {

if (context.parameters.sampleDataSet.paging != null && context.parameters.sampleDataSet.paging.hasNextPage == true) {

//set page size


//load next paging


} else {

//After load all the records, render the HTML to show the records





In this way, we can easily load all the records of selected view in lesser time by using setPageSize() method of Paging.