Notifications
Announcements
No record found.
Hi,
I have a c# plugin, and i need to display a popup to user.
What is the c# code to do that ?
Thanks,
Paul
*This post is locked for comments
The only method to display a message box to the user from a plugin is using an exception from the validation stage. You could use javascript however, perform a simple OData query on the On_Save event of the form, and display an alert box with whatever information you'd like, and cancel the saving of the form.
Refer this:
stackoverflow.com/.../how-to-send-alert-to-user-via-plugin-without-using-invalidpluginexecutionexcepti
Refer this also:
social.microsoft.com/.../displaying-alert-from-plugin-in-crm-2011
Hi Paul,
This isn't possible. You can pass a message from a plugin to a user by throwing an exception, the user will get the exception message but they wont be able to reply.
I would suggest a dialog using custom workflow activities or using of Onload, OnSave Javascript functions .
You can display a popup by throwing an exception, but why would you do that?
Thanks.
throw new InvalidPluginExecutionException("text");
This shouldn't be used for anything but for testing purposes.
not supported wayt to do this
Hi Paul
If you need this pop up (for prompting) I recommend you to use custom action validation.
Then you use the return to ask the user still proceed or not.
I used this before.
missdynamicscrm.blogspot.com/.../crm-2013-custom-action-as-validation.html
shanewcunningham.blogspot.com/.../crm-2015-create-custom-action-to.html
If plugin as long as you use odata to proceed it you can show it by manipulating the result.
But again this doesnt mean you can a pop up from plugin. You just use the plugin as validation and the rest you proceed yourself and you might need another flag field to skip the next validation in the plugin otherwise it will keep in looping
missdynamicscrm.blogspot.com/.../convert-crm-plugin-message-to-crm-alert-form-notification-javascript-from-plugin-csharp.html
I recommend you to use custom action. Similar to plugin but you can trigger using js and manipulate the output from the result un your action.
Hope this helps.
Thanks
We can throw an exception and display a message.
throw new InvalidPluginExecutionException("Message here....");
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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
SA-08121319-0 4
Calum MacFarlane 4
Alex Fun Wei Jie 2