Table of contents

 




Official Content

It is a system event that is activated when an object starts running. It is commonly used to assign values to variables that, during the object's execution, will be used either for arithmetical operations or as flags.   

Syntax

Event Start
        Event_code
EndEvent

Where:

Event_code
   Code associated with the event. 

Scope

Objects: Transaction, Web Panel, Panel, WorkWith

Description

The Start event is activated when an object starts running. It is commonly used to initialize variable values that may be displayed on the screen or not; after that, during the object's execution, those variables are used, for example, for arithmetical operations or as flags. In this event, you can also invoke objects or codify whatever you need to do when the object starts running.

Attribute values are not instantiated yet. Only attributes received by parameter (in the Parm rule) contain those received values.

In Transaction objects and Web Panel objects, the Start event is executed when the page is loaded (GET) and with every POST to the server.

In Panel objects, it is executed only the first time it is opened on a device. It is not executed again unless the panel is exited and opened again.

Samples

1) In a Panel object you may want to keep the date and time the object was opened:

Event Start
    &DateTime = Now()
EndevEnt

2) When executing a Web Panel, you may want to control access by calling a Procedure object:

Event Start
   ChkSecurity(&WebUserExtKey, &WebUserLogin, &aUserProfiles(), &aUserRights(), &Message)
   if not Null(&Message)
      ShowMessage(&Message)
   EndIf
EndEvent

 

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