dlgEvent_OnExec
Function called to open custom form.
Syntax
PUBLIC FUNCTION dlgEvent_OnExec(
p_whereRelation STRING,
p_uiSettings UISettings_Type)
RETURNS (INTEGER, SMALLINT)
The function has two parameters:
p_whereRelation
. This is a string defining theWHERE
clause specified by the entity relation in the BA diagram.p_uiSettings
. This isRECORD
type containing the UI Settings defined on the relation for the form. The type is defined in the libdbappFormUI file in the libdbapp library.
- An integer is returned with the
SQLCA.SQLCODE
error number. Codes are defined as constants in the libdbappSql and libdbappCore libraries. - A
SMALLINT
value is returned. It defines the type of user action for the form. Actions are defined as constants in the libdbappFormUI file in the libdbapp library.
Usage
When you select the On Exec property for the creation of the event, a function shell is created. Enter your code in the function.
This function is called to perform the function of opening the form. You can add code to this function to perform or modify actions for a custom form.
Examine the demo applications for examples of custom code use:
- In the OfficeStore demo, the OrderLoginCustomForm form provides an example of a custom form implementing a login.
- In the OfficeStoreMobile demo, the AccountSplash form provides an example of a custom form implementing a splash screen.
Example: On Exec
This example uses the On Exec event for the OrderLoginCustomForm form in the OfficeStore demo.
In this example, the function is called to initialize a login form. A window is opened with the
form and a MENU
dialog is created for the user to close the form.
PUBLIC FUNCTION dlgEvent_OnExec(p_whereRelation STRING, p_uiSettings UISettings_Type) RETURNS (INTEGER, SMALLINT)
DEFINE errNo INTEGER
DEFINE actionNo SMALLINT
CALL libdbappCore.log(C_LOG_INFO, "dlgEvent_OnExec (Form scope) is raised")
--Sample user code
OPEN WINDOW w_OrderLoginCustomForm WITH FORM 'OrderLoginCustomForm'
MENU
ON ACTION close EXIT MENU
END MENU
CLOSE WINDOW w_OrderLoginCustomForm
RETURN errNo, actionNo
END FUNCTION
For more information on the libdbappCore.log()
function,
go to DBAPPDEBUG and the debug level API.