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 :
Customer experience | Sales, Customer Insights,...
Unanswered

Subgrid/view Pagination not working for Virtual Entity

(0) ShareShare
ReportReport
Posted on by 490

Hello All,

I am facing one concern in MS Dynamics CRM where we are using one Virtual Entity and showing its data as a subgrid in Account Entity.

Problem is, we have set per page record limit to 20 in the grid(which cannot be changed or increased). If we get the data of more than 20 records, remaining records move to next page. 

But however, we are not able to move to next page in this subgrid. Any idea to resolve this would be very helpful. Neither the sorting and filter works.

pastedimage1624017928583v1.png 

I have the same question (0)
  • Francisco Avelino da Silva Junior Profile Picture
    5 on at

    Hello,

    you need to develop all pagination handling, interpreting the queryexpression pageinfo received in the plugin.

    Reading the pageinfo:

    if (query.PageInfo != null)
    {
    pageNumber = query.PageInfo.PageNumber;
    pageSize = query.PageInfo.Count;

    offset = $" OFFSET {(pageNumber - 1) * pageSize} ROWS FETCH NEXT {pageSize + 1} ROWS ONLY";
    }

    Editing the SQL query with the offset and doing a count query...:

    command.CommandText = $"SELECT FIELDS FROM TABLE{orderString}{offset}";
    queryCount = $"SELECT COUNT(*) FROM TABLE";

    Informing the entity collection about the presence of new records:

    if (readerCount.HasRows)
    {
    while (readerCount.Read())
    if (!readerCount.IsDBNull(0)) total = readerCount.GetInt32(0);

    collection.MoreRecords = total > pageNumber * pageSize;
    collection.PagingCookie = "<cookie page='" + pageNumber + "'> <ENTITY_NAME last='{" + collection.Entities[collection.Entities.Count - 1].Id + "}' first='{" + collection.Entities[0].Id + "}' /> </cookie>";
    collection.TotalRecordCount = total;
    }

  • Adnan Haider Profile Picture
    5 on at

    Hi Vishal,

    Did you solved the paging issue? If yes, would you like to share it?

    I am using virtual connector in dataverse to create virtual entity and facing same paging issue. To me it seems paging is not implemented in virtual connector.

    Thanks,

    Adnan

  • MahakJain Profile Picture
    65 on at

    Did you get resolution to this issue?

  • Marc PowerDoc Profile Picture
    5 on at

    how did you get your records in a subgrid

    "Although you can add virtual table columns as a lookup on a grid or other UI views, you cannot filter or sort based on this virtual table lookup column. "

    If I want to show records in subfrid the list is empty while I can show the total list

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

News and Announcements

Season of Giving Solutions is Here!

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Pallavi Phade Profile Picture

Pallavi Phade 101

#2
Tom_Gioielli Profile Picture

Tom_Gioielli 72 Super User 2025 Season 2

#3
TAHER Mehdi Profile Picture

TAHER Mehdi 58

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans