dlgEvent__action__AfterPhone

Function called by relation event after calling the phone.

Syntax

PUBLIC FUNCTION dlgEvent__action_action_AfterPhone( 
   dlg ui.DIALOG, errNo INTEGER, errMsg STRING, phoneNumber STRING )

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. phoneNumber. This is the phone number to dial.

Usage

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

This function is called when a phone call is made.

Example: After Phone Call

This example uses the After Phone Call code event on a relation. The Action property of the relation is set to callContact. Every time a user makes a phone call from the application, that phone call interaction is logged by a local SQLite database.

PUBLIC FUNCTION dlgEvent__action_callContact_AfterPhone(dlg ui.Dialog, errNo INTEGER, errMsg STRING, phoneNumber STRING)

    IF errNo == ERROR_SUCCESS THEN
        TRY
            EXECUTE IMMEDIATE "INSERT INTO phoneHistory VALUES(\""||phoneNumber||"\",\""||CURRENT YEAR TO SECOND||"\")"
        CATCH
            DISPLAY "ERROR: " || status || " " || SQLERRMESSAGE
        END TRY
    ELSE
        DISPLAY "ERROR: [" || errNo || "] " || errMsg
    END IF
    
END FUNCTION