I have a Plugin on the Creation, Updating, and Deletion of the OpportunityProduct entity in the CRM 2011. I want to through exception on the success of some operations, means want to display dialog. It is working fine for Update and Delete. But it is not working fine for the Creation of OpportunityProduct, it is not throwing exception in the dialog. It is showing Exception: “An error has occurred, Try this action again. If the problem continues, check the Microsoft Dynamics CRM Community for solution or contact your organization’s Microsoft Dynamics CRM Administrator. Finally, you can contact Microsoft Support.”
- Message : Create
- Primary Entity : opportunityproduct
- Action: Pre-Operation
- Execution Mode: Synchronous
I think this is an internal issue that relates to how CRM treats compound entities such as opportunity product. To verify this behavior you should put breakpoint in your code and inspect the context depth and parent context to understand if the create event is indeed a child process or the opportunity. If so you might be able to re-register the plug-in the opportunity and try to somehow throw the error from there.