web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested Answer

How to use InvalidPluginExecutionException in UCI

(0) ShareShare
ReportReport
Posted on by 120

I use Mscrm 365 on-premise, in my last version (2016) there was a use in InvalidPluginExecutionException function to show the user an error.

In 365 I get the error but not the text I wrote, example in the image.
How can I use the  InvalidPluginExecutionException like before and show a message to the user ? if I can't is there an other way function that Ii can use ?

 failerror.PNG 

I have the same question (0)
  • Suggested answer
    Pradeep Rai Profile Picture
    5,489 Moderator on at

    Hi,

    Please refer below link:

    https://carldesouza.com/dynamics-365-raise-error-plugin/

    Thank You,
    Pradeep Rai.

  • damka Profile Picture
    120 on at

    Thank you for your answer but my plugin config is the same and still I don't get my text message.

  • Pradeep Rai Profile Picture
    5,489 Moderator on at

    Can you please share your code?

  • Pradeep Rai Profile Picture
    5,489 Moderator on at

    Is there any Realtime workflow is setup for same entity?.

    Because it seems that you have workflow register on same entity and now you are trying to execute plugin for the same.

    Please confirm.

  • damka Profile Picture
    120 on at

    Regardless what the exception is I need show the user my text.

    This is my code, simple

    if (serviceAppoitmentBLService.CheckExistenceCatalogNumbers(target))

                   {

                       throw new InvalidPluginExecutionException("PLEASE CHECK");

                   }pastedimage1673939051748v1.png

  • Suggested answer
    Pradeep Rai Profile Picture
    5,489 Moderator on at

    Strange.

    But have checked  the method which you are calling in if condition?

    May some business condition might be throwing error.

    Also, can you remove all code just write  throw new InvalidPluginExecutionException("Please test");

    Code and run.

    If it worked then if condition has some error.

  • damka Profile Picture
    120 on at

    The condition is ok, I get the error (it is on the mail question under the black line) I need but I get the error In formation with my text, and not only my text.

  • Suggested answer
    TNS Profile Picture
    1,197 on at

    Hi, seeing your error it look likes your workflow is getting failed, so your plugin is not getting executed. As per your error it's a real time workflow and real time workflow runs earlier than synchronous plugin. So if you are getting error on workflow the your plugin should run.

    So you can try by stopping your workflow and then check. If you are getting correct message from your plugin or not. And if yes then fix your workflow.

  • Pradeep Rai Profile Picture
    5,489 Moderator on at

    It is default behaviour of plugin, whenever you will through the message it give error info along with your custom message

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 69 Most Valuable Professional

#2
ManoVerse Profile Picture

ManoVerse 66 Super User 2026 Season 1

#3
11manish Profile Picture

11manish 45

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans