Building and Modifying Infor LN Sessions: Developer Guide
Sessions are the fundamental building blocks of the Infor LN user interface. Every screen a user interacts with—from Sales Order entry (tdsls4100m000) to Item Master maintenance (tcibd0101m000)—is a session. Understanding session architecture is essential for LN developers because sessions control the form layout, field behavior, data validation, business logic triggers, and navigation flow. This guide covers creating new sessions from scratch and modifying existing sessions safely.
Session Architecture and Types
Every LN session consists of three components: the form definition (screen layout stored in the data dictionary), the BShell script (business logic), and the session properties (configuration metadata). LN supports four session types: Type 1 (Single Record Maintenance) for CRUD operations on a single table row, Type 2 (Multi-Record Display) for grid-based browsing with filtering, Type 3 (Report/Process) for batch operations and print jobs, and Type 4 (Dashboard/Overview) for composite displays. Choosing the correct session type at creation time determines the entire UI behavior pattern.
- Type 1 sessions: use for master data maintenance (items, customers, suppliers); the session auto-generates Find, New, Save, Delete toolbar buttons; form fields map directly to table columns via the data dictionary domain definitions
- Type 2 sessions: use for transaction overviews (order lines, journal entries); the session renders a scrollable grid with column sorting and filtering; each row maps to one table record; double-click navigation to the detail Type 1 session is configured via the session's zoom-to property
- Type 3 sessions: use for batch processes (MRP run, GL posting, report generation); the form collects input parameters (date range, warehouse, status filter) and the BShell script processes records in a loop; always include progress reporting via progress.bar() calls
- Create a new session: in the LN development tools, navigate to Session Management (ttadv2100m000), enter a new session code following the naming convention [module][sequence][type]000 (e.g., tcspc0501m000), select the session type, and assign the primary table
Form Design and Field Configuration
The session form defines the visual layout and field behavior. Forms are designed in the LN Form Editor, which arranges fields in a grid layout with labels, input controls, and group boxes. Each form field is bound to either a table column (via the data dictionary) or a local variable defined in the BShell script. Field properties control editability, visibility, mandatory status, default values, and zoom references. The form definition is stored as metadata in the data dictionary and rendered at runtime by the LN UI framework.
- Add a field to a form: open the Form Editor (ttadv1100m000), select your session, drag a domain-typed field from the field palette onto the form canvas; the field automatically inherits its label, input mask, and validation rules from the data dictionary domain
- Configure field triggers: use before.field (fires when the user enters the field), after.field (fires when the user leaves the field), and on.field.change (fires when the value changes) triggers in the BShell script to implement validation and auto-population logic
- Choice fields (enumeration dropdowns): define choice fields using the 'choice.field' declaration in BShell with numbered options: choice.field(i.status, 1, "Open", 2, "Closed", 3, "Cancelled") — the numeric values are stored in the database while the text labels are displayed
- Conditional field visibility: use field.set.visible("fieldname", true|false) in BShell triggers to show/hide fields based on business context; for example, hide warranty fields when the item type is not 'Serialized'
- Form sections and tabs: group related fields into labeled sections using group.box() in the form definition; for complex sessions with 50+ fields, use tab pages to organize fields into logical categories (General, Financial, Logistics, Custom)
Session Communication and Zoom Patterns
LN sessions communicate through zoom sessions (lookup windows), session-to-session parameter passing, and shared memory segments. The zoom pattern is the most common: a user clicks the zoom icon on a Customer field, which opens the Customer zoom session (tdsls0501m000) in a popup; the user selects a customer, and the selected value is returned to the calling session. Session parameters allow a parent session to pass filter criteria to a child session, and the child can return result values. Understanding these patterns is essential for building connected session workflows.
- Configure zoom sessions: in the data dictionary, assign a zoom session to a domain type; every field using that domain automatically gets a zoom button; the zoom session code is defined in the domain properties under 'Reference Session' (e.g., domain tccom100 references zoom session tccom0100m000 for Business Partners)
- Pass parameters between sessions: use start.session("tdsls4100m000", session.parms$) where session.parms$ is a pipe-delimited string of field=value pairs; the receiving session reads parameters in its before.display trigger using get.session.parm$("fieldname")
- Return values from zoom sessions: the zoom session sets return values using ret.set.field("fieldname", value) before closing; the calling session receives the values in its after.zoom trigger and can validate or transform them before applying to the form
- Multi-session workflows: for complex processes like order-to-cash, chain sessions using start.session.and.wait() which blocks the parent session until the child completes; use this for wizard-style step-by-step entry processes
- Avoid deep session nesting (>5 levels): each nested session consumes a server process; deep nesting causes performance degradation and confuses users; refactor deeply nested workflows into tabbed single sessions or process-based Type 3 sessions
Build better Infor LN sessions faster with Netray's AI-assisted development tools—get instant BShell code generation and form design recommendations.
Related Resources
Infor LN BShell Programming Fundamentals
Master Infor LN BShell scripting with this developer guide covering 4GL syntax, database operations, session hooks, and debugging techniques for BAAN/LN ERP.
Infor LNInfor LN Domain Structure and Design Guide
Design robust Infor LN domain structures including data dictionary domains, table relationships, key definitions, and index strategies for BAAN/LN development.
Infor LNInfor LN Workflow Automation Setup Guide
Configure Infor LN workflow engine for approval routing, escalation rules, and automated business process orchestration with step-by-step setup instructions.