Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Show warning (NOT error) message to user from plugin

In the CRM solution I am working on, there is a case where the user needs to be shown a warning message based on plugin execution results after submitting a particular form. The operation should still complete successfully, so throwing an exception from the plugin is not a good solution.

From searching around, there does not seem to be a straight-forward way to do this.

Is the only option to save the warning message contents to a custom field on some entity and use a javascript function on the form to determine when to display it to the user?

like image 816
K. Oja Avatar asked Oct 21 '25 16:10

K. Oja


1 Answers

  1. Implement a Custom Workflow Activity with the business logic your plugin is currently doing.

  2. Create and activate an action that uses that Workflow Activity.

  3. Code a JS function associated to the form's OnSave event that calls this action by doing a WebApi request. Lastly, after the action is processed you can call the out of the box setFormNotification Client API to create a custom warning message at the top of the form.

You will end up with a nice custom message like this:

enter image description here

like image 93
André Cavaca Avatar answered Oct 23 '25 07:10

André Cavaca



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!