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?
Implement a Custom Workflow Activity with the business logic your plugin is currently doing.
Create and activate an action that uses that Workflow Activity.
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:

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