Brilliant Database Software - Home
Database software - Online Help System

Online Help System

Back to Brilliant Database Web-Site | Write to Support | Help Index



Events

table border="0" width="100%" cellspacing="0" cellpadding="4" bgcolor="#00000077">
Events

This section describes events in Brilliant Database for which scripts can be created, and specifies what predefined variables can be used in these events. For example, for the "On Edit" event the [$old_value] variable is available into which the value of the field before it was changed is written.

For a Form (Record)

Scripts for the form events are specified in the form properties on the "Scripts and Behaviour" tab.

On Record Select

This event is called right after the user passes to the record in the following cases:

  • The record is selected in the main program window (for example, from the list of records in a folder)
  • The record is opened in the pop-up window (for example, on clicking the relational field)
  • The form for specifying variables is opened

On Confirm

This event is called when the user finishes editing the record (before changes are saved). This event allows you to perform data check.

Predefined variables:

  • [$cancel]. If you set the value of this variable equal to 1 in the script, the record will not be closed and saved. For example, in such script you can check if values in all fields of the records are specified correctly and, if something is wrong, display a warning message and set [$cancel] = 1.
  • [$is_ok]. If the user is editing a record in a separate window, the [$is_ok] variable will contain information about the way the user tried to finish work with the record: "1" - clicking the "OK" button, "0" - clicking the "Cancel" button or closing the window.

Note: This event will be called only if the record has been changed.

On "Add" Action

Brilliant Database has a number of standard methods to create a new record not using scripts:

  • From the "Add->..." main menu
  • By pressing the "Ins" key on the list of records in the current folder

You can predefine these actions by specifying your script in the 'On "Add" Action' property - for example, to add preliminary data input.

Predifined variables:

  • [$type] - where the script can be called from. Possible values:
    • "menu" - from the "Add" menu
    • "list" - by pressing the "Ins" key

For a Field

Scripts for field events are specified in the field properties on the "Scripts and Behaviour" tab.

On Edit

This event is called when the user finishes editing a field. For example, if you have three fields [First Name], [Last Name] and [Full Name], for the [First Name] and [Last Name] you can specify a script in the "On Edit" event that will automatically update the value of the [Full Name] field.

Predefined variables:

  • [$old_value] - this variable contains the value of the field before the field was changed.

On Left Button Click

This event is called at the left mouse click on the field. The event is available not for all types of fields.

On Right Button Click

This event is called at the right mouse click on the field. The event is available not for all types of fields.

On Double Click

This event is called at the double mouse click on the field. The event is available not for all types of fields.

On Enter Key

This event is called when the "Enter" key is pressed. The event is available for simple text fields.

On "Ins/Del" Key

This event allows you to predefine the standard action that will be called when the "Ins/Del" is pressed on the many-to-many relational field.

  • [$key] - the pressed key that can be "Ins" or "Del".

    Misc

    These events can be edited from the Script Editor ("Design DB->Edit Scripts..." menu).

    On WinAPI SendMessage

    This event is called when a message sent from another program by means of WinAPI SendMessage is received.

    Predefined variables:

    • [$wparam] - WParam value, for the WM_USER message (number);
    • [$lparam] - lParam value, for the WM_USER message (number);
    • [$dwdata] - dwdata value from the COPYDATASTRUCT structure (number);
    • [$lpdata] - lpdata value from the COPYDATASTRUCT structure (string).

    On Network SendMessage

    This event is called when a message sent by means of Send Network Message is received from the database user.

    Predifined variables:

    • [$text] - message text
    • [$from] - name of the user who sent the message
    • [$cancel] - if at script execution the value of this variable is equal to "1", the message will not be added to the Notification Area when it is received. The database will also be blocked/unblocked if the message contains the corresponding instruction.

    Notification Button Click

    This event is called when the user clicks the notification button in the notification area. To create a notification, use the Show Notification action.

    Predefined variables:

    • [$text] - text of the notification
    • [$btext] - text of the notification button
    • [$pars] - content of the string specified in the "Pass to the notification script" parameter of the Show Notification action used to create this notification.



    All topics in the "About Scripts" section: