We will learn to get the total record count of a grid in Dynamics 365. Before we start, make sure to subscribe to CRM Crate so that you stay up to date in the field of Dynamics 365.
Using getTotalRecordCount client API –
We will use the getTotalRecordCount client Web API for getting the total number of row count present in the sub-grid.
getTotalRecordCount (Client API reference)Returns the total number of records that match the filter criteria of the view, not limited by the number visible in a single page.
1. When the Dynamics 365 for Outlook client isn’t connected to the server, this number is limited to those records that the user has selected to take offline.
2. For Dynamics 365 mobile clients, this method will return the number of records in the subgrid.
Validate the changes in Dynamics 365
Once the above code is configured and published, navigate to the Dynamics 365 and validate the changes as shown below.
Thus, learned to get the total record count of a sub-grid in Dynamics 365.