ExecuteMultipleRequest Class


Updated: November 29, 2016

Applies To: Dynamics 365 (online), Dynamics 365 (on-premises), Dynamics CRM 2016, Dynamics CRM Online

Contains the data that is needed to execute one or more message requests as a single batch operation, and optionally return a collection of results.

Namespace:   Microsoft.Xrm.Sdk.Messages
Assembly:  Microsoft.Xrm.Sdk (in Microsoft.Xrm.Sdk.dll)


[DataContractAttribute(Namespace = "http://schemas.microsoft.com/xrm/2011/Contracts")]
public sealed class ExecuteMultipleRequest : OrganizationRequest


Initializes a new instance of the ExecuteMultipleRequest.


Gets or sets the structure that contains extra data. Optional.(Inherited from OrganizationRequest.)


Gets or sets the indexer for the Parameters collection.(Inherited from OrganizationRequest.)


Gets or sets the collection of parameters for the request. Required, but is supplied by derived classes.(Inherited from OrganizationRequest.)


Gets or sets the ID of an asynchronous operation (system job). Optional. (Inherited from OrganizationRequest.)


Gets or sets the name of the request. Required, but is supplied by derived classes.(Inherited from OrganizationRequest.)


Gets or sets the collection of message requests to execute.


Gets or sets the settings that define whether execution should continue if an error occurs and if responses for each message request processed are to be returned.


(Inherited from Object.)


(Inherited from Object.)


(Inherited from Object.)


(Inherited from Object.)

Message Availability

This message works regardless whether the caller is connected to the server or offline.


Pass an instance of this class to the Execute method, which returns an instance of the ExecuteMultipleResponse class.

Privileges and Access Rights

There are no specific privileges required for this request. Refer to the required privileges and access rights of each message request you add to the Requests collection. Refer to Privileges by message.

Notes for Callers

CallerId is honored for each message request. See the related topics for throttling limitations.

The following sample shows how to execute the ExecuteMultipleRequest message.

// Get a reference to the organization service.
using (_serviceProxy = new OrganizationServiceProxy(serverConfig.OrganizationUri, serverConfig.HomeRealmUri,serverConfig.Credentials, serverConfig.DeviceCredentials))
    // Enable early-bound type support to add/update entity records required for this sample.

    #region Execute Multiple with Results
    // Create an ExecuteMultipleRequest object.
    requestWithResults = new ExecuteMultipleRequest()
        // Assign settings that define execution behavior: continue on error, return responses. 
        Settings = new ExecuteMultipleSettings()
            ContinueOnError = false,
            ReturnResponses = true
        // Create an empty organization request collection.
        Requests = new OrganizationRequestCollection()

    // Create several (local, in memory) entities in a collection. 
    EntityCollection input = GetCollectionOfEntitiesToCreate();

    // Add a CreateRequest for each entity to the request collection.
    foreach (var entity in input.Entities)
        CreateRequest createRequest = new CreateRequest { Target = entity };

    // Execute all the requests in the request collection using a single web method call.
    ExecuteMultipleResponse responseWithResults =

    // Display the results returned in the responses.
    foreach (var responseItem in responseWithResults.Responses)
        // A valid response.
        if (responseItem.Response != null)
            DisplayResponse(requestWithResults.Requests[responseItem.RequestIndex], responseItem.Response);

        // An error has occurred.
        else if (responseItem.Fault != null)
                responseItem.RequestIndex, responseItem.Fault);

Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top

Microsoft Dynamics 365

© 2016 Microsoft. All rights reserved. Copyright