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 CRM (Archived)

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

(0) ShareShare
ReportReport
Posted on by

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

I have the same question (0)
  • gdas Profile Picture
    50,091 Moderator on at

    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.

  • Community Member Profile Picture
    on at

    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.

  • Suggested answer
    Arpit Shrivastava Profile Picture
    7,518 User Group Leader on at

    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
    on at

    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

  • Verified answer
    gdas Profile Picture
    50,091 Moderator on at

    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
    on at

    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.

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 CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans