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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

Warning message is not displaying even if it reads the message.

(0) ShareShare
ReportReport
Posted on by 534

Hi Guys,

I need to display the warning message. when I debugged it is reading the warning but it is not displaying the message.

but when I tried this in runnable class it is working fine.

Example -

warning(strFmt("%1", ID));

Note - Throw warning is working, but without "throw" keyword it is not working. 

  • Verified answer
    GirishS Profile Picture
    27,843 Moderator on at

    Hi jenifer,

    You need to use throw keyword to throw an exception during the process execution.

    But try using Message class to throw warning.

    Message::Add(MessageSeverity::Warning,"Warning message");

    Thanks,

    Girish S.

  • Adam123 Profile Picture
    534 on at

    Is there is any way that I can populate the warning message without stopping the process, if I use throw it will stop the process.

  • Adam123 Profile Picture
    534 on at

    Hi Girish

    I have tried this but it is not working.

  • Martin Dráb Profile Picture
    240,748 Most Valuable Professional on at

    Please give us more information about your situation.

    You said it's working fine in a runnable class, but not at the place where you need it. What is the place? Isn't it called from a method that removes messages added to infolog?

  • Adam123 Profile Picture
    534 on at

    Hi Martin,

    In form clicked method I am calling one class static method , inside this static method I am writing this warning.

  • Verified answer
    Martin Dráb Profile Picture
    240,748 Most Valuable Professional on at

    I don't know what you have in ID variable, so let me simplify it. Please let me know if the following correctly describes steps to reproduce your problem.

    1. Create a new class with a static method containing a call of warning() method. Like this:

    internal final class MyWarningTest
    {
        internal static void showMessage()
        {
            warning("Test message");
        }
    }

    2. Create a new form, add a button, override its clicked() and call the previously defined method there.

    3. Build the solution, run the form and press the button.

    Result: The message isn't shown in infolog.

    Please try it. I'm assuming you'll see the message, which would mean that you didn't give us correct information about your actual scenario.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 426 Most Valuable Professional

#2
CU10121822-0 Profile Picture

CU10121822-0 358

#3
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 353 Super User 2026 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans