Do you know that we have the Virtual Connectors in Dataverse (Preview) solution in the AppSource that can let us configure and create Virtual Entity easily? We can do the CRUD (Create-Read-Update-Delete) operation directly (I tried the SQL Server connection) and it works perfectly as long as you set the Table design correctly. If you are interested in it, you can follow this link to implement it in your trial environment.
As you know, in the Dataverse we have several Event Pipeline that we can apply to do customization in the selected table (I found the below picture from MS Learn Page that you can read here):

In the picture above, we can set our Plugin to run on PreValidation, PreOperation, and PostOperation (Sync and Async). In the Common Table (not Virtual Entity), when there is an error on PostOperation-Sync, the system will roll back all the transactions to the initial stage. Based on this, I tested how the Virtual Connectors in Dataverse work using the below code:
using Microsoft.Xrm.Sdk;
using System;
namespace DemoPlugin
{
public class Plugin1 : IPlugin
{
public void Execute(IServiceProvider serviceProvider)
{
throw new InvalidPluginExecutionException("testing");
}
}
}
Then let’s try updating the below data:

First, I register this Plugin in the PreOperation Pipeline. Then I go to the UI > Update the data > click Save (it will throw an error) and when checking from DB Level, the name still ‘T00000332-Test’:

Next, I tried to change the Plugin to the PostOperation and change the data like the previous step. When click save, we will get the same error but in the Database, the name value has already changed:

Inspect in the DB and here is the result:

Hope it gives you information and Happy CRM-ing!
One thought on “Virtual Connectors in Dataverse Not Rollback When Got Error On PostOperation-Sync”