Recents

 


Start eventOfficial Content

Defines an action to be performed when the object starts running. It is a system event which 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 Smart Devices, it is executed only the first time a Panel for Smart Devices object or a WWSD 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 to the event. 

Examples

If we need to control access to the transaction, we 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 objectPanel for Smart Devices objectWWSD

Was this page helpful?
What Is This?
Your feedback about this content is important. Let us know what you think.