Official Content

Displays warning messages.

Syntax

Msg( Message [ , nowait | status ] )

Where:
Message
    The message to be displayed. It can be constant or stored in a variable. It is possible to add newlines in the string.

Mode
    There are two modes to display the message, each one with an associated constant value:

  • nowait

Stores the message in an internal variable and processing continues. The user will not see the message until program processing ends. This improves program performance as less screen input/output is required.
For Native Mobile applications, it works as a "toast message".

  • status

The message is displayed at the moment it is originated. It is useful for giving the user information about program processing status.

Scope

Objects: Procedure, Transaction,Web Panel, Panel
Generators: Apple, Android.NET,  Java

Considerations

  • This message option degrades performance due to the required screen input/output.
  • It is used to display the literal, variable, or character expression contents in the message popup window (or message line, depending on the working environment).
    The moment when the user actually sees the message will depend on where the command is declared and on the option selected.
  • When using a variable, GeneXus controls, at specification time, that the variable type is Character.
  • When the Mode option is not specified:
    • Web Panels and Transactions
      It sends the message and waits for the Enter key to be pressed.
    • Procedures
      See status option.
    • Panels
      Msg has no effect in Start, Refresh, and Load events in Panels as it is considered a Client-side event.
Note: To customize the text format, please refer to HowTo: Format plain text programmatically. Only available since GeneXus 15.

Samples

Msg("Hello user." + newline() + "Have a good day!")
Msg(&Today)
Msg(Format('B: %1', B))                   // Where B is Character type
Msg(Concat('Entered Date: ',  DtoC(C)))   // Where C is Date type.
Msg(Concat('Entered Date Hour', TtoC(D))) // Where and D is Datetime type.
&var = "Hello user." + newline() + "And on this line I say: good day to you"
Msg(&var, nowait)                         // Where &var is character type

See Also

Msg rule
Format function
Client-side Events in Native Mobile Applications
Server-side Events in Native Mobile Applications



Last update: June 2025 | © GeneXus. All rights reserved. GeneXus Powered by Globant