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

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Answered

Show custom pop up message when plugin complete task

(3) ShareShare
ReportReport
Posted on by 3,174
Hi Everyone
Is there a way to show a message once the plugin complete a task- success or fail message. For example "Document created successfully!"
I have the same question (0)
  • Verified answer
    Amit Katariya007 Profile Picture
    10,409 Super User 2025 Season 2 on at
    Show custom pop up message when plugin complete task
    In Dynamics 365, plugins run server-side, so they don't have direct access to the user interface to display messages. However, you can achieve this functionality using one of the following approaches:
     
    1. Use a Custom Action and Synchronous Workflow/Plugin
     
    Create a custom action that triggers your plugin logic.
    Call this action from a JavaScript web resource or through Power Automate.
    Return the success or failure message as part of the action's response.
    Display the message to the user using JavaScript on the form or a dialog.
     
    Steps:
     
    1. Create a custom action in the Dynamics solution.
    2. Register the plugin on the custom action's execution.
    3. Use JavaScript to call the action and handle the response.
    4. Show error message using openAlerDialog api.
     
     
    2. Throw Exceptions in Plugin
     
    If the plugin fails, you can throw an exception with a user-friendly error message. Dynamics will display the error to the user.
    For successful operations, this method doesn't work, as no "success message" mechanism exists for plugins.
     
    Example:
     
    if (operationFailed)
    {
        throw new InvalidPluginExecutionException("Document creation failed due to invalid data.");
    }
     
    3. Use a Real-Time Workflow/Flow to Update a Field
     
    Update a custom field (e.g., "Status Message") on the record with the success or failure message after the plugin completes.
    Add a notification or JavaScript logic to display the message when the field is updated.
     
    Steps:
     
    1. Create a custom text field on the entity (e.g., statusmessage).
    2. Update the field from your plugin with the desired message.
    3. Use form scripting to display the field's value as a notification.
     
    var statusMessage = formContext.getAttribute("statusmessage").getValue();
    if (statusMessage) {
        Xrm.Navigation.openAlertDialog({ text: statusMessage });
    }
     
    4. Create a InApp Notification.
    You can create a InApp Notification from plugin it self. So no need of Any Client side code.
     
     
    Which Approach to Choose?
     
    Simple error messages: Throw exceptions in the plugin.
    Interactive success and error messages: Use Custom Actions or Custom APIs with JavaScript.
    Record-level feedback: Update a field with the message and display it using form scripting.

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Rishabh Kanaskar Profile Picture

Rishabh Kanaskar 258

#2
MVP-Daniyal Khaleel Profile Picture

MVP-Daniyal Khaleel 184

#3
Tom_Gioielli Profile Picture

Tom_Gioielli 126 Super User 2025 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans