The On Startup Database Method is called once when you open a database.
This occurs in the following 4D environments:
4D Client (on the client side, after the connection has been accepted by 4D Server)
4D application compiled and merged with 4D Runtime Volume License
Note: The On Startup Database Method is NOT invoked by 4D Server.
The On Startup Database Method is automatically invoked by 4D; unlike project methods, you cannot call this database method yourself. To call and perform tasks from within the On Startup Database Method, as well as from project methods later on, use subroutines.
The On Startup Database Method is the perfect place to:
Initialize interprocess variables that you will use during the whole working session.
Start processes automatically when a database is opened.
Load Preferences or Settings saved for this purpose during the previous working session.
Prevent the opening of the database if a condition is not met (i.e., missing system resources) by explicitly calling QUIT 4D.
Perform any other actions that you want to be performed automatically each time a database is opened.
Compatibility with previous versions of 4D
Database methods are a new type of method introduced in version 6. In previous versions of 4th Dimension, there was only one method (procedure) that 4D automatically executed when you opened a database. This procedure had to be called STARTUP (US English INTL version) or DEBUT (French version) in order to be invoked. If you use a converted version 5 database and if you want to take advantage of the new On Startup Database Method capability, make sure that the Use Old Startup Method property in the Preferences dialog box of the database is not checked. This property only affects the STARTUP/On Startup Database Method alternative. If you do not deselect this property and add, for instance, an On Exit Database Method, this latter will be invoked by 4D.
See the example in the section On Exit Database Method.
Database Methods, Methods, On Exit Database Method, QUIT 4D.