Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Answered

Plugin error while using Custom Data Provider for Update operation on Virtual entity

(0) ShareShare
ReportReport
Posted on by 2,116

I'm trying to use virtual entity in D365 CRM On-Premises using a custom data provider. I have created Update , Retrieve and Retrieve Multiple event handler in the data provider.

Out of this, Retrieve & Retrieve Multiple works fine.

But when I try to add the event for Update, the plugin registration tool throws an error as:

Message: Invalid plug-in registration stage. Steps can only be modified in stages BeforeMainOperationOutsideTransaction, BeforeMainOperationInsideTransaction, AfterMainOperationInsideTransaction and AfterMainOperationOutsideTransaction.

  

Any help is appreciated. 

Thanks

 

pastedimage1676270027024v2.png

pastedimage1676270033610v3.png

 

 

CRM Version:

 pastedimage1676270015954v1.png

  • Chris2at Profile Picture
    6 on at
    Plugin error while using Custom Data Provider for Update operation on Virtual entity
    Actually, you can update the DataProvider, but only when there is no virtual entiy connected to it.
    When you temporary change the virtual entity to have 'None' DataProvider, you can update the DataProvider.
    The only problem is that you still have to re-create the virtual entity, because the privileges of the entity are not recreated when setting the entity back to the DataProvider that now supports all CRUD operations.
    So it will not have the Create / Write / Delete privileges and the form will stay 'readonly', there will be no Create nor Delete button.
     
    I will create a new problem post for this, but I'm not sure if I will get any answer... :(
  • Suggested answer
    Mandar Joshi Profile Picture
    2,116 on at
    RE: Plugin error while using Custom Data Provider for Update operation on Virtual entity

    Thank you for your response.

    As I'm adding these plugin steps to an custom data provider, I don't have an option to select the stage. Also, If I create a new Data Provider then I can add the plugin steps successfully for it. But after changing the Virtual Entity data source to point to new Data Provider, I record is still readonly. Similar to what is mentioned in blog post below.

    www.itaintboring.com/.../

    I was able to fix the issue by recreating the Virtual Entity pointing to new Data Provider. Note that updating the Data Provider on exiting Virtually did not worked.

  • Verified answer
    Kosenurm Profile Picture
    85 on at
    RE: Plugin error while using Custom Data Provider for Update operation on Virtual entity

    In Dynamics 365 CRM On-Premises, when using a custom data provider for a virtual entity, the Update event handler can only be registered in certain stages: BeforeMainOperationOutsideTransaction, BeforeMainOperationInsideTransaction, AfterMainOperationInsideTransaction, and AfterMainOperationOutsideTransaction.

    The error message you are seeing indicates that the registration tool is trying to add the Update event handler in an invalid stage. To resolve this issue, you will need to update the registration tool to add the Update event handler in one of the supported stages.

    To do this, open the plugin registration tool and select the step that is causing the error. Then, update the stage to one of the supported stages listed above, and save the changes. After updating the stage, you should be able to register the Update event handler for the custom data provider without encountering the error message.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 293,245 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,925 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Product updates

Dynamics 365 release plans