Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

what do they mean TotalRecordCount and ent.Entities.Count ?

Posted on by 267

Hi

when we use service.RetrieveMultiple() in our plugin there are two properties people check:

what does exactly mean by TotalRecordCount ?

what does exactly mean by Count ?

when TotalRecordCount  can be null instead of -1 ?

 

In my case i have one record in my collection and above mentioned properties showing following result: can any one explain please.

ent.TotalRecordCount -1
ent.Entities.Count 1

Thank you in advance.

*This post is locked for comments

  • Verified answer
    gdas Profile Picture
    gdas 50,085 on at
    RE: what do they mean TotalRecordCount and ent.Entities.Count ?

    Hi Zuab ,

    Please find the answers -

    what does exactly mean by TotalRecordCount ?

    To find out how many records the query returned, set the ReturnTotalRecordCount property to true before executing the query. When you do this, the TotalRecordCount will be set. Otherwise, this value will be -1. You can pass this parameter like below -

    PagingInfo.ReturnTotalRecordCount

    For more info check below reference -

    docs.microsoft.com/.../gg334688(v=crm.8)

    docs.microsoft.com/.../gg307670%28v%3dcrm.8%29

    what does exactly mean by Count ?

    Count is gives you the number of records available in the EntityCollection.

    when TotalRecordCount  can be null instead of -1 ?

    When you set ReturnTotalRecordCount  property then it will set  TotalRecordCount with number of records retrieved and when you do not set ReturnTotalRecordCount property by default it will always return -1.

    Hope this helps.

  • Verified answer
    Arun Vinoth Profile Picture
    Arun Vinoth 11,613 on at
    RE: what do they mean TotalRecordCount and ent.Entities.Count ?

    If ReturnTotalRecordCount property was false when the query was executed, the value of TotalRecordCount property will be -1.

    [View:https://docs.microsoft.com/en-us/previous-versions/dynamicscrm-2016/developers-guide/gg326940(v%3Dcrm.8)]

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

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans