Kbase P85651: Dynamics. How to show messages with Buttons, like in ADM2
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  23/06/2004 |
|
Status: Unverified
GOAL:
Dynamics. How to show messages with Buttons, like in ADM2
GOAL:
ShowMessages API
FACT(s) (Environment):
Dynamics 2.1A
FIX:
showMessages
This is the central procedure for the displaying all message types including Message (MES), Information (INF), Warnings (WAR), Errors (ERR), Serious Halt Errors (HAL), and AboutWindow (ABO). Any button combination is supported.
The default message type is ERR. The default button list is OK. The default label to return is OK, if OK exists. Otherwise, the default is the first button in the list. The default cancel button is also OK, or the first entry in the button list. The default title depends on the message type.
If running server-side, the messages cannot be displayed and can only be written to the message log. Because there is no user interface on the server side, the default button label is returned.
If running client-side, the messages are displayed in a dialog window. The procedure checks the property "suppressDisplay" in the Session Manager. If it is set to YES, the procedure does not display the message. The message is passed to the log. This is useful when running take-on procedures client side.
The messages are passed to the procedure, af\app\afmessagep.p, on the AppServer for interpretation. This procedure performs the necessary tasks to return the formatted messages.
This might include the following tasks:
? Formatting the messages appropriately
? Reading the text from the Dynamics message file
? Interpreting the carrot-delimited lists that come back from triggers
? Dealing with ADM2 CHR(4)-delimited messages
? Translating the message if required
Once the messages have been formatted, a client-side message is displayed using the standard Dynamics message dialog, af\cod2\afmessaged.w. On the server-side, the Dynamics error log is updated with the error and, if possible, an e-mail is sent to the currently logged-in user to notify them of the error. This process is also followed if the error log flag is set to YES or message display suppression is enabled.
Parameters:
INPUT pcMessageList AS CHARACTER
INPUT pcMessageType AS CHARACTER
INPUT pcButtonList AS CHARACTER
INPUT pcDefaultButton AS CHARACTER
INPUT pcCancelButton AS CHARACTER
INPUT pcMessageTitle AS CHARACTER
INPUT plDisplayEmpty AS LOGICAL
INPUT phContainer AS HANDLE
OUTPUT pcButtonPressed AS CHARACTER
Notes: When running client-side, the procedure returns the untranslated button text of the pressed button. When running server-side, the untranslated button text of the default button is returned.
Example:
RUN showMessages IN gshSessionManager (
INPUT cMessage,
INPUT "INF",
INPUT "OK",
INPUT "OK",
INPUT "",
INPUT "Browser Settings",
INPUT NO,
INPUT ?,
OUTPUT cButtonPressed ).