News Ticker

Faster and Safer Data Integration/Migration in CRM 2015 Update 1


Data Integration/Migration has always been a challenge in any Dynamics CRM implementation. The native Data Import utility cannot handle the complex data migration/integration specially with complex relationships between different entities. For a long time developers have been writing applications or SSIS packages for data integration using the CRM SDK. One of the fundamental challenge with CRM SDK has been that message execution were not transnational i.e. there was no rollback possible.

Let’s take the following scenario. We need to create a contact and then associate it with its parent account records as primary contact. There are two transactions: CREATE of Contact and UPDATE of Account. With ExecuteMultipleRequest command of SDK, it was possible to send both these messages together to CRM for execution. But what was not possible was to rollback the whole transaction if the CREATE succeeds but the UPDATE fails.

Dynamics CRM 2015 Update 1 SDK has introduced ExecuteTransactionRequest which allows to execute multiple requests in a transaction, which means if any one of these requests execution fails the whole transaction will be rolled back.

By definition, a transaction is a sequence of operations performed as a single logical unit of work. Transaction is fundamental for data integrity and transactions must exhibit Atomicity, Consistency, Isolation, and Durability (ACID) properties, to qualify as a transaction.

The following code illustrates how ExecuteTransactionRequest can be used:

ExecuteTransationRequest

 

 

 

 

The Transnational batch works on the following principles:

  • It executes two or more organization service requests in a single database transaction.
  • The message requests in the Requests collection are executed in order as they appear in the collection, where the element at index 0 is executed first.
  • If any one of the requests fail and the transaction is rolled back, any data changes completed during the transaction are undone.
  • Set ReturnResponses to true to get back a collection of responses.
  • The maximum allowed Batch size is 100 i.e. up to 100 requests per transaction request is allowed.
  • CRM online has a throttling of 2 concurrent batch requests. If we send more than 2 simultaneous batch requests to CRM online server, we will get an error indicating the server is busy.
  • We can mix CreateRequest and UpdateRequest in the same Transactional Request batch.

The

About Dipankar Bhattacharya (59 Articles)
A multi-skilled Dynamics 365 Professional with strong experience in delivering IT projects especially across multiple industries. A Microsoft technology evangelist, a regular speaker at tech events, blogger and avid reader. Certified IT Architect and well versed in Solution Architecture of Business Applications using Microsoft platforms like Dynamics 365, Azure and Office 365.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: