How can I know that a InvalidPluginExecutionException was raised in the entity form RRS feed

  • Question

  • I have a pre Update Plug in for the Quote entity, sometimes I throw an exception to notify to the user that the state of the quote is not valid. In the client side I want to know if the update operation raised an exception in order to show some warming message in the form.

    I tried using the Execution Context in the OnLoad event, I couldn't find any usable value there. Do you know how to get that information?

    Wednesday, May 14, 2014 11:12 PM

All replies

  • Hi Marcelo,

    I believe you can update a hidden field in the form using the Plugin with some pre-defined value instead of raising an exception from your Plugin; and use client side script to read that field value and show warning messages. The hidden field value would provide means of communication between the server side Plugin and your client side JavaScript. I have used this mechanism in some of my projects.

    Admin QuikView Solution for CRM 2013

    Thursday, May 15, 2014 6:29 AM
  • Well, Plugin will rollup back your changes if you will throw exception so updating field won't work, Do you want to try form notification ?? Have an idea you can implement your business logic in your plugin and instead of throwing exception set that exception to some field, and in onload check if that field has some value show it using form notification.

    Our Website| Our Blog | Follow US | My Facebook Page | Microsoft Dynamics CRM 2011 Application Design
    Make sure to "Vote as Helpful" and "Mark As Answer",if you get answer of your question.

    Thursday, May 15, 2014 7:25 AM