locked
CRM 2011 - Plugins Exception Handling (Custom Errors) RRS feed

  • Question

  • Experts/Gurus,

    Before i spend time on this, i would like to check with you all first.

    Currently for the exception handling we are using throw new InvalidPluginExecutionException(......)
    But the error messages are not user friendly and they are very confusing for the users.

    Is there any way around to modify the way exception handling messages are displayed.
    Any chance i can have just an error box?

    Thanks,
    Sam

    Friday, July 20, 2012 11:48 PM

Answers

  • If you register your plugin to fire on the pre-event stage - for one of the ovverides of the InvalidPluginExecutionException, the first parameter is the friendly message. It will be displayed to the user in the form of a pop up message.

    InvalidPluginExecutionException Constructor (String)

    In the plug-in examples in the SDK you can see examples of this in use.


    Jason Lattimer

    Saturday, July 21, 2012 3:10 AM
    Moderator

All replies

  • If you register your plugin to fire on the pre-event stage - for one of the ovverides of the InvalidPluginExecutionException, the first parameter is the friendly message. It will be displayed to the user in the form of a pop up message.

    InvalidPluginExecutionException Constructor (String)

    In the plug-in examples in the SDK you can see examples of this in use.


    Jason Lattimer

    Saturday, July 21, 2012 3:10 AM
    Moderator
  • Thanks Jason, i didn't think of catch block :) one of those days....
    I was doing throw new Exception within try block and in the catch block i had the StackTrace :) that was concatenated with Message string.

    Cheers!

    Tuesday, July 24, 2012 6:29 PM