Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics 365 | Integration, Dataverse...
Answered

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

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
    Chris2at 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
    Mandar Joshi 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
    Kosenurm 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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans