AdvancedInfor LNLN Studio / DAL2 Business Logic

How to extend business logic in Infor LN with DAL2

Question
how to extend business logic in Infor LN without modifying standard DAL

Also searched as

  • infor ln dal2 custom validation
  • dal2 business logic handler example infor ln
  • how does dal2 work in infor ln
  • infor ln customization without changing base code

Short answer

DAL2 lets you add custom validation, defaulting and calculation logic to Infor LN Enterprise Edition tables by writing a Java business logic handler class and registering it against a table event, without editing the standard DAL. Because the logic sits in your own package rather than inside Infor's base code, it survives upgrades that would otherwise overwrite a direct DAL change.

Applies to: Infor LN Enterprise Edition (LN Studio, Java-based DAL2 runtime)

Add a DAL2 business logic extension

  1. 1Open Infor LN Studio and connect to your development VRC (Version-Release-Customer) package combination.
  2. 2In the Package Explorer, create or open a custom package that is separate from Infor's standard packages; never edit a standard package directly.
  3. 3Create a Java class that extends the business logic handler for the table you want to affect, targeting the event you need (for example a validate or before-store event).
  4. 4Write the condition or default in the handler using the DAL2 API to read and set field values on the business object.
  5. 5Register the handler against the table and event, specifying the sequence relative to any standard handlers already on that event.
  6. 6Compile the package in LN Studio and resolve any dependency or field-reference errors against the base table definition.
  7. 7Deploy the package to a test VRC and run the affected session end to end to confirm the handler fires as expected.
  8. 8Check the LN application log for handler execution and for any exceptions thrown from your class.
  9. 9Promote the package through test and acceptance VRCs before production, following your normal Infor LN change control process.

Why DAL2 instead of classic DAL

Classic DAL is procedural 4GL logic compiled per table inside a VRC package. Editing it directly to add a custom rule means your change lives inside code Infor owns, so the next patch or upgrade can silently overwrite or conflict with it.

DAL2 solves this by layering Java business logic handlers on top of the base logic instead of inside it. Each handler is a separate class, registered against a table and event, that runs alongside the standard behavior rather than replacing it.

This matters most for Infor LN Enterprise Edition sites on the Java-based runtime, where DAL2 and LN Studio are the supported customization path and classic 4GL DAL editing is discouraged for exactly this upgrade-safety reason.

Handler types and events

DAL2 handlers typically attach to events such as validate, before-store and after-store on a table's business object. A validate or before-store handler can reject the action outright by raising a business logic exception with your own message text.

An after-store handler is useful for logic that needs the record to already exist, such as triggering a downstream update once a header is saved. Default-value logic is usually set in a before-store or field-level handler so the value is in place before the record commits.

Packaging and VRC discipline

Keep every DAL2 extension in its own custom package, never inside an Infor-owned package, and follow a clear naming convention so anyone reviewing the package structure can immediately tell which handlers are custom.

On upgrade, the base VRC and its packages get replaced while your custom package is untouched, but that is not a guarantee nothing breaks. If the target table's structure changed, your handler can reference a field that moved or was renamed, so re-test every DAL2 extension against the new VRC rather than assuming it just keeps working.

A common pattern: reject and default in one place

A frequent real-world use of DAL2 is combining a rejection rule with a default value on the same table, for example blocking a negative quantity while defaulting a custom classification field. Both live in the same handler class so the rule is easy to find and maintain later.

// Illustrative DAL2 handler pattern (conceptual, not a literal SDK signature)
public class SalesOrderLineValidator extends BusinessLogicHandler {
  public void beforeStore(BusinessObject bo) {
    if (bo.getDecimal("orderedQuantity") < 0) {
      throw new BusinessLogicException("Ordered quantity cannot be negative");
    }
    if (bo.getString("customClass") == null) {
      bo.setString("customClass", "STANDARD");
    }
  }
}

Common pitfalls

  • !Editing the standard DAL directly instead of using a DAL2 extension, which gets lost on the next patch or upgrade.
  • !Registering a handler without checking the execution order of existing standard handlers, causing double validation or a skipped default.
  • !Assuming a DAL2 extension will keep working after an LN upgrade without re-testing it against the new VRC.
  • !Throwing raw exceptions instead of a clear business logic exception, so end users see a generic error instead of a useful message.
  • !Mixing DAL2 Java logic and classic 4GL DAL customization on the same table, so business rules end up split across two technologies.
  • !Deploying straight to production without promoting through test and acceptance VRCs and re-checking dependent sessions like order-to-invoice.

How an ERP-grounded AI assistant handles this

A developer assistant grounded in your LN package structure can scan the handlers already registered on a table before you add a new one, flag a conflicting event sequence, and draft the validate or before-store skeleton with your team's naming conventions already applied, so review time goes into the business rule itself rather than package plumbing.

Frequently asked questions

What is the difference between DAL and DAL2 in Infor LN?

Classic DAL is procedural 4GL logic compiled per table inside a VRC package. DAL2 is Java-based business logic layered on top through registered handler classes, introduced for LN Enterprise Edition so customizations survive upgrades without patching base tables.

Can I use DAL2 on a classic (non-Java) Infor LN installation?

No. DAL2 requires the LN Enterprise Edition Java-based runtime and LN Studio. Installations still on the classic 4GL runtime use traditional DAL customization or session-level scripting instead.

Where do I register a DAL2 handler?

Inside LN Studio, against the table you are extending, specifying the event (such as validate or before-store) and the class implementing the handler, then compiling and deploying the containing package to your VRC.

Will a DAL2 extension break during an Infor LN upgrade?

It can, if the underlying table structure, field name or business object interface changes between releases. Re-test every custom handler against the new VRC before go-live rather than assuming it will keep working unchanged.

Related

Advanced

How to create a custom session in Infor LN Studio

Infor LN Studio's session designer generates a new maintenance, overview or detail session from a table definition, then lets you arrange fields, attach DAL2 validation, and wire menu access, all inside a custom package so the session survives upgrades. Building on a custom table gives the lowest upgrade risk; extending a standard table needs more care and re-testing after every release.

How-to

How to publish a BOD from Infor LN to Infor ION

Publishing a Business Object Document from Infor LN means flagging the relevant table or session for BOD publish, confirming LN's connection point to Infor ION is active, and building the document flow in ION Desk so changes like a new sales order are broadcast as a standard OAGIS-style XML message that other applications can subscribe to.

Advanced

How to diagnose and fix a slow Infor LN session

A slow Infor LN session is usually caused by an unindexed or overly broad database query, unarchived data bloating a transaction table, or resource pressure on the Java application tier, and occasionally by a recently added custom DAL2 handler. The fix starts with isolating which tier the delay is actually in rather than guessing at a solution.

How-to

Baan IV to Infor LN migration checklist

Moving from Baan IV to Infor LN is a re-implementation, not an in-place upgrade, because the two products differ in data model, session technology and, for LN Enterprise Edition, the underlying runtime. The checklist centers on inventorying customizations, converting master data, rebuilding logic rather than porting it, and running a real parallel test before cutover.

Error fix

Infor LN bshell Process Stuck at 100% CPU: How to Diagnose and Fix It

A bshell process pinned at 100% CPU on the Infor LN application server almost always means one session is stuck in a 4GL loop, scanning an unindexed table, or waiting on a database lock. End the session from the Sessions Monitor first, then kill the OS process only if that fails, and check for a blocking database transaction before assuming it is a bug.

Error fix

Infor LN Not Authorized to Run This Session: How to Fix It

Infor LN refuses to open a session with a not authorized message when the logged-in user's assigned role does not include that session, or when the session is blocked for the company they are logged into. Grant the session through Common > Authorization Management > Roles, or check the user's role and company context, and the session opens on retry. In most cases this is a permissions configuration issue, not a bug.

AI for ERP

AI for Infor LN: Sessions, BODs, and Engineer-to-Order Work

Add grounded AI to Infor LN 10.x or CloudSuite: natural-language answers over sessions and BODs, agents for project and engineer-to-order work, on-prem options.

AI for ERP

AI for Infor LN in Aerospace and Defense Manufacturing

AI grounded on Infor LN project, contract, and configuration management data for aerospace and defense manufacturers, with on-prem deployment for ITAR.

Stuck on Infor LN?

Talk to engineers who work inside Infor LN every week, and who build private AI that answers these questions from your own ERP data.