Skip to main content

Notifications

Dynamics 365 Community / Blogs / Learn with Subs / Infos and warning messages ...

Infos and warning messages won't work on your WHMS app, if you haven't done this

Subhad365 Profile Picture Subhad365 7 User Group Leader
 

Hi friends, in a D365F&O application for Warehouse Management using mobile apps, if you are planning to put an info or a warning message in the middle of a code, in response to a validation, your code might not work, if you have written a code like this:
if (counter > maxNumberOfAttempts)
{
    warning ("You have exceeded maximum number of attempts");

}
The underlying code will simply ignore it. This is because the WHMS supporting classes don't understand any info, warning or error message, unless if you have made it a part of ProcessGuideMessageData and ProcessGuideNavigationParameters classes. For example, going with the above example, we want our mobile app to throw a warning message whenever the qty given in a given for an item is more than some value. Then you need to wire up the code like this:
if (counter > maxQty)
{
    ProcessGuideMessageData messageData = ProcessGuideMessageData::construct();
    ProcessGuideMessageData messageData = ProcessGuideMessageData::construct();
    messageData.message = "You have exceeded the number of allowed attempts.";
    messageData.level = WHSRFColorText::Warning;


    navigationParametersFrom = ProcessGuideNavigationParameters::construct();
    navigationParametersFrom.messageData = messageData;
} 
This you need to write in the doExecute() or validateControl() method of the Process Guided Prompt class.
When you have done this, the warning gracefully show up like this:




Yeah, that's how it works -- you have to emboss the warning message in the process guide class, that's the trick😅
​​​​​​​

Comments

*This post is locked for comments