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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

How to display a popup in c# plugin

(0) ShareShare
ReportReport
Posted on by

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

I have the same question (0)
  • Suggested answer
    Rajkumar Rajaraman Profile Picture
    on at

    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

  • Rajkumar Rajaraman Profile Picture
    on at

    Refer this also:

    social.microsoft.com/.../displaying-alert-from-plugin-in-crm-2011

  • Verified answer
    JayeshAC Profile Picture
    1,157 on at

    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 .

  • Erry Handani Profile Picture
    95 on at

    Hi Paul,

    You can display a popup by throwing an exception, but why would you do that?

    Thanks.

  • Community Member Profile Picture
    on at

    throw new InvalidPluginExecutionException("text");

    This shouldn't be used for anything but for testing purposes.

  • Community Member Profile Picture
    on at

    not supported wayt to do this

  • Suggested answer
    Aileen Gusni Profile Picture
    44,524 on at

    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

  • Saddamk206 Profile Picture
    777 on at

    Hi, 

    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.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans