Using ADAPL programs
ADAPL is a complete programming language which can access every part of Collections databases and applications. ADAPL programs can be written to perform certain tasks independently of the application itself, e.g. to print reminders for overdue books.
ADAPL programs can run independently using RunAdapl.exe or they can run in the background after the user has performed certain actions in a Collections application.
The Collections database interface is what makes this language unique and very efficient. Namely, an adapl you use from within Collections (after you've opened a data source) is always executed per record; depending on where in the execution of Collections the adapl is started - see below, this could mean just the currently opened record, or per record for all marked records in the Result set for example. Each time the adapl is being run, a record is copied into a buffer (called adlib_lite). It is this buffer from which the adapl can subtract all data immediately by using the record tags as if they were variables, and edit them if necessary. The edited tags in the buffer will be copied back automatically to the actual database record only if the adapl is of a type that automatically writes back from the buffer, namely a before-storage adapl, that is carried out when the user saves or deletes a record, or when importing records. Most other types of adapls write any edited tags automatically back to a record if it is in edit mode, but these are only saved in the record if the user approves and saves the record manually; these are before-screen adapls (after-screen adapls are not supported by Collections), field based procedures, and copy, input, and edit record procedures. In the remaining types of adapl you can only save edited tags by using FACS for the local database table (see FACS).
Screen procedures
Before-screen adapl - Before-screen adapls (also known as before-display procedures) can be linked to a detailed display screen through the Screen properties of the form. The corresponding adapl is then run immediately prior to the associated screen being opened for the current record. The ADAPL program accesses the data from the record as database variables and is therefore able to edit, suppress or otherwise process the presented data.
One practical use of a before-screen adapl, is to format certain field entries and add punctuation marks or to swap first names and surnames so that they read naturally.
After-screen adapls are not supported by Collections.
Database procedures
On the Procedures tab of the database properties it is possible to link six types of ADAPL programs to a database definition, namely: Storage procedures, After retrieval procedures, Copy record procedures, Input record procedures, Edit record procedures, and Field based procedures. These adapls are executed automatically after a user performs a certain action on this database table in a Collections application. See the Help topic for the Procedures properties tab, for more information about each adapl type.
Note that adapls linked to screens take precedence over those specified in database definitions.
Database field procedures
Link screen procedure (filter adapl) - This adapl is used in link screens (the Find data for the field window) to determine which records are displayed or not displayed in this screen. It can also be used to decide which elements of a record you want to display. You can set which Link screen procedure you want to use, in the Link screens properties of a data dictionary field.
Manually started procedures
• | Print adapl (stand-alone or output format) - Print adapls are usually implemented as output formats associated with a data source. Output formats are executed for every record marked for printing. Further, adapl output formats may be solely responsible for printing or may be programmed to print in combination with a Word template (more information about that here ). For some details about how to use ADAPL for formatting plain text printer output, please see the Help topic Output formats. In the Using Word templates topic you'll find a brief overview of how to call a Word template from within an adapl. |
• | Import adapl - An import adapl does not import records itself: per record which is being imported, it processes data from the exchange file to allow for some data conversion before it is actually written to the target fields. An import adapl can be set in import jobs: it runs during the actual import. |