dlgEvent__action__AfterMail

Function called by relation event after sending an email.

Syntax

PUBLIC FUNCTION dlgEvent__action_action_AfterMail( 
   dlg ui.DIALOG, errNo INTEGER, errMsg STRING, mail MailSettings_Type)

The action part of the function name is defined by the Action property of the relation (under Source UI Settings) . If the Action property is not set, an error will occur at compile time.

The function has four parameters:

  1. dlg. This is a ui.DIALOG object referencing the current dialog. The dialog can implement an INPUT, INPUT ARRAY, DISPLAY ARRAY, MENU, or CONSTRUCT. For more information, see The Dialog class in Genero Business Development Language User Guide.
  2. errNo. This is an SQLCA.SQLCODE error.
  3. errMsg. This is the SQLERRMESSAGE message.
  4. mail. This is the type of mail sent.

Usage

When you select the After Sending Mail property for the creation of the event, a function shell is created. Enter your code in the function.

This function is called when a mail is sent.

Example: After Sending Mail

This example uses the After Sending Mail code event on a relation. The Action property of the relation is set to sendMail. Every time a user sends a mail, a message is displayed.

PUBLIC FUNCTION dlgEvent__action_sendMail_AfterMail(dlg ui.DIALOG, errNo INTEGER, errMsg STRING,  mail MailSettings_Type)

    IF errNo == ERROR_SUCCESS THEN
        DISPLAY "Mail sent, type: " || mail 
    ELSE
        DISPLAY "ERROR: [" || errNo || "] " || errMsg
    END IF
    
END FUNCTION