Session Synchronization

Synchronized sessions overview

LN provides several mechanisms for starting one session from another – these are zoom fields, synchronized sessions, and the 4GL start.session() function. This topic describes synchronized sessions and associated functions. When two sessions are synchronized, actions performed on one session window have a direct effect on the other session window. LN implements two synchronization models:

  • Dialog synchronization
  • Child synchronization

Dialog synchronization

This synchronizes a multi-occurrence parent session with a single-occurrence dialog session. Both sessions act on the same main table. The parent session can be a modeless multi-occurrence display form or a modal multi-occurrence zoom window.

When the user double-clicks on an occurrence in the parent session, the 4GL engine automatically opens the synchronized dialog (details) session (if it is not already open) and updates it with information from the selected record. Whether the dialog opens in edit or display mode depends on user authorization settings. The synchronized dialog is also opened automatically when the user initiates one of the following actions: insert record, edit record, or duplicate record.

When a record is saved in the synchronized dialog, the 4GL engine automatically updates the occurrence in the parent window.

The synchronization must be defined in the Overview session, it can be specified on two ways:

  • Define the function set.synchronized.dialog ("details session code") in the before.program section of the UI script.
  • Define the details session code in the Synchronized Dialog field of the Sessions (ttadv2100s000) session.
Note: Overview session and Detail session can be the same session.

Example: Overview and Detail sessions are separate sessions

Business Partners:

Overview session: tccom4500m000

Details session: tccom4100s000

Example: Overview and Detail session is the same session

Employees:

Overview session: tccom0101m000

Details session: tccom0101m000

Child synchronization

Normally, this is used to synchronize sessions that act on different main tables. In this case, the primary key of the parent's main table must be a subset of the primary key of the child's main table.

For example, take an Orders table that lists client orders, and an Order lines table that lists order lines per order. The primary key of the Orders session is orderno. The primary key of the Order lines session is orderlines.orderno. In the Order lines session, orderno is a foreign key that references the Orders table.

With child synchronization, you can synchronize a parent session that uses the Orders table with a child session that uses the Order lines table. The user chooses a form command to open the child session from the parent session. So the user can view the order lines associated with the orders listed in the parent session.