web
You’re offline. This is a read only version of the page.
close
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

I have the same question (0)
  • Verified answer
    Kosenurm Profile Picture
    85 on at

    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.

  • Suggested answer
    Mandar Joshi Profile Picture
    2,116 on at

    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.

  • Chris2at Profile Picture
    6 on at
    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... :(

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
Martin Dráb Profile Picture

Martin Dráb 45 Most Valuable Professional

#2
iampranjal Profile Picture

iampranjal 36

#3
Satyam Prakash Profile Picture

Satyam Prakash 31

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans