Form Events Handling using AutoScript

Those procedures are put into the Form's AutoScript section

Form_Start ( form_id )

Call this procedure at the opening of the Form. All data has been load by default. The form_id is the handle of the Form. 

Form_End ( uvalue )

Call this procedure after the Form has been closed by saving the data (append, edit or delete). The uvalue contains the unique field's value after the posting of the Form 

Form_AfterForward()

Form_AfterStay()

Form_Prepared()

Call this procedure when we want to put some AutoScript just before the Form is displayed to the user.

Form_OpenFK_[fieldname] ( fkvalue, fkform )

Call this procedure to change the default behaviour of just opening the foreign key's Form by pressing the "related button". The fkvalue is the value of the foreign key and fkform is the form of the related record (for witch the foreign key is the "unique key" 

[editboxname]_OnChange ( value )

Call this procedure just after the changing of the value of the editbox with name [editboxname]  

Form_Close()

Form_Resize()

Panels_Start()

NotBk_OnTabClick[pageindex]()

NotBk_OnTabClick_[pagename]()

Lst_Click()

[listname]_Click()

Lst_DblClick()

[listname]_DblClick()

Form_DrawCell()

Form_MultiSelectLoad_[fieldname]()
This procedure is used in forms that open in browsing mode. It is used in order to change the default list loading behavior in the filtering windows. The code below gives an example of its usage:

proc Form_MultiselectLoad_FIELD1()

       start_sql "*" "KOSMOS"
         SELECT FIELD1 FROM TABLE1
       end_sql
       q = QueryByName()
       call TExecute(q)
       count = TRecordCount(q)
       call TFirst(q)
       for i = 1 to count
            val = TGetFld(q,"FIELD1")
            call CbLoad("FIELD1",val)
            call TNext(q)
       next
       call FreeEmbSQL(q)
end

Panel_[panelname]_BeforeLoad()

Form_OnSelect()

Select_[tablename]_Params()