Search This Blog

Wednesday, March 16, 2016

Executing Messages in a Single Transaction in Dynamics CRM 2015

Executing Messages in a Single Transaction in Dynamics CRM 2015
In CRM 2015, you can now execute multiple CRM requests in a single transaction. This gives developers the ability to easily rollback or cancel transactions if one of the CRM requests within the transaction fail.

We can now use the "ExecuteTransactionRequest" message which will automatically rollback the entire transaction if any of the associated requests fail.

Example:
We are going to create a record in three different entity.

1.Create a instance of sales order,invoice and email
2.Form a create request
{
{
{
{
{
{
{
{
}
}
}
{
}
{
 I have created a plugin which will force the Invoice to fail during creation, so we can see what happens.
The entire transaction rollback no record is created. 

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.