Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

InvalidPluginExecutionException results in generic "An error has occurred" not "Business Process Error" dialog

Posted on by Microsoft Employee

Hello, I am hoping someone can help with this issue I am having with the UI dialogs that result from throwing InvalidPluginExecutionException in CRM plugins. Ordinarily when doing so, a "Business Process Error" dialog appears that surfaces the provided error message from the plugin. However specifically for handling win opportunity messages, I am not getting a "Business Process Error" dialog but instead a generic "An error has occurred". I am throwing the InvalidPluginExecutionException in the same way as in other plugins that handle create/change messages on other entities.

I have found this old forum post regarding a similar issue, however using the suggested multi catch approach is not working:

https://social.msdn.microsoft.com/Forums/sqlserver/en-US/d7bc391d-32a1-4d7d-8cd5-48e459d4aeff/invalidpluginexecutionexception-dialog-does-not-show-up-crm-2011?forum=crmdevelopment

catch (InvalidPluginExecutionException)
{
    throw;
}
catch (FaultException<Microsoft.Xrm.Sdk.OrganizationServiceFault> ex)
{
    throw new InvalidPluginExecutionException("An FaultException occurred in the OnCreatePluginTest plug-in.", ex);
}
catch (Exception ex)
{
    throw new InvalidPluginExecutionException("An Exception occurred in the OnCreatePluginTest plug-in.", ex);
}

Is there something that I am missing? It seems peculiar that this is only occurring for handling the win opportunity message. I appreciate any insights into this issue.

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: InvalidPluginExecutionException results in generic "An error has occurred" not "Business Process Error" dialog

    Ok thank you for confirming that for me. It would be great is this was resolved as I'd expect InvalidPluginExecutionException

    messages to be shown as expected regardless of the message/entity type if no system level error has occurred.

  • Verified answer
    gdas Profile Picture
    gdas 50,085 on at
    RE: InvalidPluginExecutionException results in generic "An error has occurred" not "Business Process Error" dialog

    Hi ,

    I don't think you can change this message  , you can not change this behavior . Since this is coming from CRM internal  assembly,  which basically convert your plugin message  as generic error .This is by design , however you can raise a ticket to Microsoft  or share your issue to Microsoft .

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: InvalidPluginExecutionException results in generic "An error has occurred" not "Business Process Error" dialog

    Hi thanks for your reply, but I am attempting to carry out custom validation on the occurrence of a win opportunity message at a pre-operation or pre-validation stage. I have thrown together the below process flow to hopefully better describe the issue I am having with this. I would be grateful for any further ideas regarding this:

    0640.Drawing1.png

  • Suggested answer
    Arpit Shrivastava Profile Picture
    Arpit Shrivastava 7,518 User Group Leader on at
    RE: InvalidPluginExecutionException results in generic "An error has occurred" not "Business Process Error" dialog

    Could you please check following thread. Hope it helps.

    community.dynamics.com/.../196010

    If my answer helped to resolve your issue, kindly verify it by clicking 'Yes'. It would be helpful to the other community members seeking to resolve a similar issue

    Cheers

    Arpit

    arpitmscrmhunt.blogspot.in

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: InvalidPluginExecutionException results in generic "An error has occurred" not "Business Process Error" dialog

    Thanks you for your reply, I have looked into this as well (enabling plugin trace), but what is confusing is that the message I passed to InvalidPluginExecutionException is displayed as the error in the downloadable log file (and in the trace), not a system level error. There doesn't appear to be a OrganizationServiceFault that is occurring prior to my plugin, so I cant see why the InvalidPluginExecutionException isnt being handled in the standard way.

  • gdas Profile Picture
    gdas 50,085 on at
    RE: InvalidPluginExecutionException results in generic "An error has occurred" not "Business Process Error" dialog

    Hi,

    This is because  when you are registering plugin in opportunity win message its basically extending some existing process and your plugin treating as a child process so whenever any error occurred its showing  the generic error .

    As an alternate you can enable plugin trace log to see the actual error .

    Hope this helps.

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,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans