In backend I have more than 2lakh records which increases hourly Client requirement : They need a count of records which should be dynamic based on filters. Ex : If user wants 1 week record it should show the record count

MAHESHWARI S. AMATYA 0 Reputation points
2024-07-26T07:37:10.7933333+00:00

So in my approach i used collection onvisible of screen i fetch initial 2000 records  and ontimerend  i fetch next 2000 on every second until I meet the condition like whole data from dataverse table fetched in collection

But I have a delay like 2min to fetch all the records in collection 

I tried to use savedata but in wont works on web application(instead of fetching again and again)

Do you suggest any solution for this?

 

This is the approach I used

---------------Onvisible of screen Property-----------------------

 

If(

    IsEmpty(FullDataSet),

    Collect(

        FullDataSet,

        FirstN(Sort('Table name','Created On', SortOrder.Ascending), batchSize)

    )

);

 

// Set variables for data loading

Set(lastLoadedRecordDate, Last(FullDataSet).'Created On');

Set(continueLoading, true);

Set(batchSize, 2000);

 

// Start Timer to load additional data

Timer1.AutoStart;

 

 

---------------OnTimerEnd-------------------

If(

    continueLoading,

    ClearCollect(

        MoreData,

        Sort(

            Filter('Table name', 'Created On' > lastLoadedRecordDate ),

            'Created On',

            SortOrder.Ascending

        )

    );

 

    If(

        CountRows(MoreData) > 0,

        Collect(FullDataSet, MoreData);

        Set(lastLoadedRecordDate, Last(MoreData).'Created On');

        Clear(MoreData);

    ,

        Set(continueLoading, false) // Stop loading if no more records

    )

);

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
39,704 questions
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.