Table of contents

 




Official Content

Apart from the standard GeneXus events, you can define your own specific events called User defined events.

A User defined event triggers an action whenever a key or button is pressed, or when an Action is selected from the Action Bar.

The shortcut key combination associated with the user event is optional, If no shortcut key is defined, the only way that the event is triggered is when user presses the associated button.

Syntax

Event user_event_name [key ]
EndEvent

Where:
user_event_name
  
Name of the user event

key
  
Number of function key associated with the event. Optional.

Examples

Web Panel

You could have defined the following:

Event 'Create Supplier' 6
    &No = 0
    CreateSupplier.Call('INS',&No)
    refresh
EndEvent

This is a user-defined event called 'Create Supplier', and F6 will be the shortcut key that will trigger the Create Supplier event. This event calls the Suppliers transaction, which receives as parameters the Insert mode and a numeric variable whose assigned value is equal to 0. After calling the Transaction, the Refresh command is executed, indicating that the grid must be loaded again, since a new supplier has been added (otherwise the newly inserted supplier will not be displayed because this data did not exist when the first load was executed).

Transaction

Prints an invoice by pressing the corresponding button associated with the event.

Event 'Print Invoice'
    PrintInvoince.Call(InvoiceNumber)
Endevent

In Transactions you may select the level at which the event will be triggered by means of the Level Sentence.

Scope

Objects   Transaction object, Web Panel object

See also

Global Events 
Level Sentence (only to be used in Transactions).

  

 

  
Last update: November 2024 | © GeneXus. All rights reserved. GeneXus Powered by Globant