I have a case where I need to print warning message based on some condition if the certain field is modified as per the debugging the condition is true and the warning message appears in (show output) but it does not appear on the application if I convert warning to info or error it appears also . I ty to use Message::Add(MessageSeverity::Warning,"WarningMessage"); it works the warning message appears my question why warning message doesn't appear if I use warning directly to print it
Warning is just a in built function. But Messsage::Add used a class to insert message to the info log.
But I am not sure why it retains the message when you add it through the Message class.
Thanks,
Girish S.
What is the difference between warning message added by Warning and the one added by Message::Add so that the first one is cleared and the second not
Oh, that's looks good. But I can't say where the warning message gets cleared.
You can go ahead and debug the code to find out when the info log message gets cleared.
Open the watch window and debug the code line by line and see when the message gets cleared from the info log window.
Thanks,
Girish S.
I took the solution from the mentioned post , I try to understand the reason for such behavior
ModifiedField also same issue. Please look at the thread which I have sent. It won't show warning message when you add it in ModifiedField method. You need to use Message class to throw warnings as you mentioned.
Thanks,
Girish S.
What about using it at ModifiedField
I guess you did not assign that warning to the return value when you say you wrote code in validatewrite or validatefield. Because these methods are for throwing error or warnings.
Seems this is a standard issue with the validateField and modifiedField method. Message:Add method will work but warning function doesn't work.
It's getting cleared at some point. If you are keen to find out why it didn't show you can debug and see where the info log gets cleared.
Refer to the below thread which talks about the same issue.
Thanks,
Girish S.
I try it on diffrent locations with same behaviour : valdiateField, ModifiedField at the table level Also I try modified method on the form in all cases same result once I use Message::Add is works
Can you please tell us in which method this warning message is written? Also, can you send the screenshot for the same?
André Arnaud de Cal...
291,965
Super User 2025 Season 1
Martin Dráb
230,836
Most Valuable Professional
nmaenpaa
101,156