How it works...

Similar to the first recipe and the transaction recipe, we started by creating a new solution and referenced the correct NuGet packages. We then added the correct library references to our class file in step 3.

In step 4, we started by connecting to Dynamics 365 by injecting a simple connection string into the CrmServiceClient class from the Microsoft.Xrm.Tooling namespace.

We then created a collection of requests: a create account request and a create contact request. We passed the request collection to the ExecuteMultipleRequest class. We also set the ExecuteMultipleSettings property to the request to continue the execution if an error is encountered and to return all responses.

We executed the request and finally displayed the ID of each response, as we set up the create requests to return the GUID of the created records.

Behind the scenes, the SDK is leveraging the low-level SQL transaction capabilities. If you have an on-premise instance of Dynamics 365, a SQL-profiler session reveals a batch start and batch complete event with the following execution:

SET TRANSACTION ISOLATION LEVEL READ COMMITTED
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.138.174.95