Skip to main content

Notifications

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 

  • Marc PowerDoc Profile Picture
    Marc PowerDoc 5 on at
    RE: Subgrid/view Pagination not working for Virtual Entity

    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

  • MahakJain Profile Picture
    MahakJain 65 on at
    RE: Subgrid/view Pagination not working for Virtual Entity

    Did you get resolution to this issue?

  • Adnan Haider Profile Picture
    Adnan Haider 5 on at
    RE: Subgrid/view Pagination not working for Virtual Entity

    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

  • RE: Subgrid/view Pagination not working for Virtual Entity

    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;
    }

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

Announcing Category Subscriptions!

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,359 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,370 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans