Udostępnij za pośrednictwem


RetrieveTotalRecordCountRequest Class

Definition

Contains the data to retrieve the total entity record count from within the last 24 hours.

public ref class RetrieveTotalRecordCountRequest sealed : Microsoft::Xrm::Sdk::OrganizationRequest
[System.Runtime.Serialization.DataContract(Namespace="http://schemas.microsoft.com/crm/2011/Contracts")]
public sealed class RetrieveTotalRecordCountRequest : Microsoft.Xrm.Sdk.OrganizationRequest
[<System.Runtime.Serialization.DataContract(Namespace="http://schemas.microsoft.com/crm/2011/Contracts")>]
type RetrieveTotalRecordCountRequest = class
    inherit OrganizationRequest
Public NotInheritable Class RetrieveTotalRecordCountRequest
Inherits OrganizationRequest
Inheritance
RetrieveTotalRecordCountRequest
Attributes

Examples

The following example shows how to use this message. For this sample to work correctly, you must have an authenticated connection to the server with a client that implements the IOrganizationService interface instance.

/// <summary>
/// Writes the count of records to the console
/// </summary>
/// <param name="service">Authenticated client implementing the IOrganizationService interface</param>
/// <param name="entityNames" />
static void OutputTotalRecordCount(IOrganizationService service, params string[] entityNames ) {

    var request = new RetrieveTotalRecordCountRequest { 
          EntityNames = entityNames
    };

    var response = (RetrieveTotalRecordCountResponse)service.Execute(request);

    foreach (var item in response.EntityRecordCountCollection) {                
        Console.WriteLine($"{item.Key} table has {item.Value} records.");            
    }

}

Example Output:

account table has 52695 records.
contact table has 153842 records.

Remarks

For the Web API use the RetrieveTotalRecordCount function.

The data retrieved will be from a snapshot within the last 24 hours.

Usage

Pass an instance of this class to the Execute(OrganizationRequest) method, which returns an instance of the RetrieveTotalRecordCountResponse class.

Constructors

RetrieveTotalRecordCountRequest()

Properties

EntityNames

The logical names of the entities to include in the query.

ExtensionData

Gets or sets the structure that contains extra data. Optional.

(Inherited from OrganizationRequest)
Item[String]

Gets or sets the indexer for the Parameters collection.

(Inherited from OrganizationRequest)
Parameters

Gets or sets the collection of parameters for the request. Required, but is supplied by derived classes.

(Inherited from OrganizationRequest)
RequestId

Gets or sets the ID of the request. Optional.

(Inherited from OrganizationRequest)
RequestName

Gets or sets the name of the request. Required, but is supplied by derived classes.

(Inherited from OrganizationRequest)

Applies to