AdvancedInfor LNTools / bshell

Infor LN Process Variables: Meaning, Setting and Inspecting

Question
infor ln process variables

Also searched as

  • infor ln bshell variables
  • baan process variables get.var put.var
  • infor ln bshell environment variables BSE

Short answer

Every Infor LN session runs inside a bshell process that carries environment variables (such as BSE, the installation root) and in-memory process variables used by the 4GL code. Developers read and set process variables from code, commonly with the 4GL calls get.var and put.var, and inspect environment values from the shell or bshell startup options. Check how your version exposes them before relying on one.

Applies to: Infor LN 10.x and ERP LN 6.x, 4GL/3GL development and administration; verify function names in your tools documentation

How to inspect and set process variables

  1. 1Identify what you need: an operating system environment variable seen by bshell (such as BSE) or a variable inside a running session's 4GL code.
  2. 2For environment values, check the bshell start-up configuration and the user's shell or service environment on the application server.
  3. 3For in-session values, add a debug print or use the 4GL debugger to view the variable in the process you are testing.
  4. 4To read a variable from another process in code, use the documented get.var call with the process id and variable name.
  5. 5To change a variable in a running process from code, use put.var, and restrict this to tooling or approved customisations.
  6. 6Test in a development environment, then document the variable, its owner and its default.

Two kinds of variable

Environment variables are set by the operating system or the bshell start-up and describe the installation: where the software lives (BSE), temp locations and similar settings. They are read when the process starts and normally stay constant for its life.

Process variables are the 4GL variables inside a running session. They live in memory, differ per process and disappear when the session ends. They hold state such as the current company, the active record and form values.

Reading and setting from code

The tools offer calls to read and set a named variable in a given process, so one session can inspect or influence another. This is powerful and should be used carefully: changing a variable in a running process can alter behaviour in ways the original author did not expect.

Keep any such use isolated in a documented library and avoid depending on internal variable names, which can change between versions.

| Illustrative 4GL sketch: confirm exact signatures in your tools documentation
long rc
string val(100)
rc = get.var(pid, "some.variable", val)

Troubleshooting differences per user or server

When a session behaves differently for one user or on one server, compare the environment of the bshell processes: different BSE values, different language settings or a different start-up script are common causes.

On Windows services versus interactive logons the environment can differ, so test with the same launch method as production.

Try it here, free

Infor LN 4GL Session Script Template

Open full tool

Generate a clean Baan / Infor LN 4GL session script skeleton with declaration, field, choice and table I/O sections.

Common pitfalls

  • !Depending on internal variable names that change between versions.
  • !Changing variables in a running process from production code without testing.
  • !Assuming a user's shell environment equals the service environment bshell actually runs under.
  • !Editing environment settings on one server and forgetting the others in the cluster.

How an ERP-grounded AI assistant handles this

Netray adds a private AI layer on top of the Infor LN you already run, including on-prem installs. ERPray answers questions in plain language over LN data read-only, shows the query it ran and respects LN roles, so a consultant can ask the question instead of hunting for the session. The model runs on your own GPUs, nothing leaves your network, and any write-back needs a human approval. Cloud-hosted LN works too, but the design is tuned for on-prem and air-gapped sites. For pure navigation questions, LN's own session search and help are often enough.

Frequently asked questions

What is BSE in Infor LN?

BSE is the environment variable pointing to the root of the LN (Baan) software installation. Most tools resolve their paths from it.

How do I read a variable from another session?

Developers use the get.var call with the process id and variable name. Check the signature and restrictions in your tools documentation before using it.

Do process variables survive a session restart?

No. They live in the memory of the process and are lost when it ends. Persistent settings belong in parameters or tables.

Why does LN behave differently on two servers?

Compare environment variables and start-up scripts of the bshell processes. Differences in BSE, language or temp paths are typical causes.

Related

Advanced

Logic Deactivation Session in Infor LN

Infor LN enforces business rules through the Data Access Layer (DAL), which runs validation and defaulting logic on every insert, update and delete. Logic deactivation is the controlled way to switch selected logic off for a defined scope, typically for a data conversion or a one-off repair, and then back on. Use it sparingly, with a backup, because rows written without logic can break integrity rules.

Advanced

Infor LN Text Table: How Text Fields Are Stored

In Infor LN, long text on records such as items, orders and customers is not stored in the business table itself. The record holds a text number, and the text lines live in the text table (tttxt010, per company), keyed by text number and language. To read text with SQL join on that number; to copy it, use the standard text copy functions rather than raw inserts.

Error fix

Infor LN 'unable to create a session': causes and how to fix it

This message means the client reached LN but the server could not start the session process (a bshell) or could not load the session. Work from the server side: check the bshell log, licence and user limits, the user's authorizations, and whether the session or its dependent objects exist and are compiled.

How-to

How to Check the Infor LN Version and Current Package VRC

An Infor LN installation has four separate version facts: the application release and feature pack, the porting set that carries the bshell and database drivers, the package VRC that each user or company runs, and the installed solutions. The release is shown in the Help > About dialog of the client, the package VRC in the Tools package administration sessions, and the porting set on the server through the installation tooling.

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.

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.

Keep exploring

Free tools

ERP fixes and how-tos

Guides

AI on your ERP

Integrations

Comparisons

Software