Table of contents

Official Content

Defines an action to be performed when the object starts running. It is a system event that takes place when an object starts running. It is commonly used to assign values to variables that, during the object's execution, will be used by counting operations or by other events, for example.  Web Panels generally use this event to place default values in the 'fixed area' of the form.

In Web interfaces, the Start event is executed when the page is loaded (get) and with every post to the server.

In mobile apps, it is executed only the first time a Panel object or a Work With pattern and Work With object node is opened on a device. It is not executed again unless the panel is exited and opened again.

Syntax

Event Start
        Event_code
EndEvent

Where:
Event_code
   Code associated with the event. 

Examples

If you need to control access to the transaction, you could call a Procedure object:

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

The Start event is used to assign the &Date variable with the value indicated by the current date before the Web Panel is displayed. This ensures that the current date can be properly shown when the panel is displayed. This technique is very useful to assign default values.

Event Start
    &Date = Today()
EndevEnt

The organization's name will be displayed at the start of the Transaction's execution:

Event Start
   &OrgName = GetOrgName.Udp(OrgCode)
EndevEnt

What this UDP does is call the Procedure called GetOrgName which returns the name corresponding to the Organization's Code (OrgCode) which has been passed as parameter and assigns it to the Organization name variable (&OrgName).

Scope

Objects: Transaction object, Web Panel object, Panel object,Work With pattern and Work With object


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