Skip to main content

Notifications

Supply chain | Supply Chain Management, Commerce
Suggested answer

How to add warning messages to the newly popup dialog?

(0) ShareShare
ReportReport
Posted on by
Hi experts,
Happy new year!
 
Here I get a new question when develop with AX.
When we select a record from the form, and click a menu item, this will trigger a RunBase class to open a new dialog.
The question is that, I want to do some check and add some warning message when the dialog shows.
 
Currently, I tried several methods, but the warning messages always shows in the original form, but not the dialog.
 
Is there any way I can add the messages to the dialog once it shows?
Can I just hook the open of dialog and write my logic? (How to hook?)
 
Thanks a lot.
 
  • Suggested answer
    Martin Dráb Profile Picture
    Martin Dráb 230,848 Most Valuable Professional on at
    How to add warning messages to the newly popup dialog?
    The message pane is indeed on the top of the app; it's not a part of individual forms. I recommend respecting how F&O UI works, rather than designing a unique solution for a single form. Note that you can use the Box API if you want to make the message very visible.
     
    If you insist on showing something in the dialog form, you we'll need to add a static text control (or something) there.
  • Kai Cheng Profile Picture
    Kai Cheng on at
    How to add warning messages to the newly popup dialog?
    Yes, that is correct, I just want to inform user, don't want to prevent them from creating a new transfer order.
     
    Actually, I tried to add warning(Not checkFailed) in validate(), dialog(), etc. method in class InventTransferOrderCreateFromSalesLine.
    But all of them will show the warning messages in the original sales order form, not the popup dialog.
    I think this is not showy enough, so I prefer to show the warning in the dialog.
    Any idea will be appreciated? Thanks.
  • Martin Dráb Profile Picture
    Martin Dráb 230,848 Most Valuable Professional on at
    How to add warning messages to the newly popup dialog?
    Do I understand that you just want to show the warning but allow users to create a transfer order regardless of the warning?
     
    Why exactly the normal way, using warning() function, doesn't work for you?
  • Kai Cheng Profile Picture
    Kai Cheng on at
    How to add warning messages to the newly popup dialog?
    Hi Komi and Martin, thanks for your response and inputs.
    Your insights are valuable.
     
    Here I want to give an example to explain my problems.
    After we create a new sales line, we can create a new transfer order for the sales line. Just go to the sales line > Product and supply > New Transfer order
    This will generate a popup dialog to create the new transfer order like below. (This menu item action refers to class InventTransferOrderCreateFromSalesLine)
     
    Currently, standard code allows users to create multiple transfer orders for a single sales line.
    What I want to do is to add a check here to inform user that an existing transfer order is created for the selected sales line when the dialog popup.
    So that is the question, can I add a pre-check and show the warnings in the popup dialog? Thanks.
     
  • Suggested answer
    Komi Siabi Profile Picture
    Komi Siabi 12,759 Most Valuable Professional on at
    How to add warning messages to the newly popup dialog?
    I am guessing you want a message displayed in a box; something like this..
    You should use the Box::yesNo method.
     
     
     
     
  • Martin Dráb Profile Picture
    Martin Dráb 230,848 Most Valuable Professional on at
    How to add warning messages to the newly popup dialog?
    Please tell us more about your requirements.
     
    Are you saying that you want to run some validations when opening the dialog form (not when the dialog is being confirmed by clicking OK button) and display some information directly in the dialog form?

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…

Vahid Ghafarpour – Community Spotlight

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

Congratulations to the January Top 10 leaders!

Check out the January community rock stars...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,848 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans