Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Answered

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

(0) ShareShare
ReportReport
Posted on by 524

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
    Martin Dráb Profile Picture
    Martin Dráb 230,836 Most Valuable Professional on at
    RE: Warning message is not displaying even if it reads the message.

    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.

  • Adam123 Profile Picture
    Adam123 524 on at
    RE: Warning message is not displaying even if it reads the message.

    Hi Martin,

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

  • Martin Dráb Profile Picture
    Martin Dráb 230,836 Most Valuable Professional on at
    RE: Warning message is not displaying even if it reads the message.

    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
    Adam123 524 on at
    RE: Warning message is not displaying even if it reads the message.

    Hi Girish

    I have tried this but it is not working.

  • Adam123 Profile Picture
    Adam123 524 on at
    RE: Warning message is not displaying even if it reads the message.

    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.

  • Verified answer
    GirishS Profile Picture
    GirishS 27,821 Super User 2024 Season 1 on at
    RE: Warning message is not displaying even if it reads the message.

    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.

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,965 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,836 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans