iModernize - The Profound Logic Software Blog

Handling Multiple Companies and Divisions within Atrium

Posted by Alex Roytman on Oct 15, 2015 3:48:25 AM

Atrium Navigation Modernization for IBM i, AS400, iSeriesAtrium is a browser based menu portal that allows you to reproduce your entire green screen menu and display it as a tree or accordion format. A user can click a menu item which starts a Genie interactive session. Genie then runs a macro which navigates though the green screen menus until it arrives at the target screen. The navigation occurs very quickly, is not visible to the user and is a very effective way to modernize and simplify access to an ERP application running on IBM i.

Recently, we have come across situations where there are multiple companies or divisions within an application. The green screen menus may allow a user to enter a company number or similar which changes the library list, thereby changing the company. A Genie macro is certainly able to detect the company field and populate a company number but there is no built-in method to choose a specific company when running an Atrium menu item. However, this can be accomplished using a little bit of JavaScript code, along with a new Atrium feature that allows you to execute JavaScript code from within a Genie Macro.

Adding a dropdown for company or division

In Profound UI, there is a special IFS directory (/www/profoundui/htdocs/profoundui/userdata/extension/atrium), which Atrium checks when it starts. Any JavaScript files in this directory will be loaded by Atrium. We can add a file (let’s call it company-atrium-extension.js) into this directory with the following sample code. This will add a label and a dropdown with three companies.

Atrium.onload = function() {

var container = document.getElementById("Atrium-addFavButton");
while (container.tagName != "DIV") {
container = container.parentNode;

var label = document.createElement("div"); = "absolute"; = "7px"; = "360px";
label.innerHTML = "Company:";

var dropdown = document.createElement("select"); = "companyNumber"; = "absolute"; = "5px"; = "200px"; = "150px";

dropdown.options.add(new Option("Acme Construction", "AC01"));
dropdown.options.add(new Option("Acme Disposal", "AC02"));
dropdown.options.add(new Option("Acme Home Improvements", "AC03"));
dropdown.value = "AC01";


The end result may look as follows:

Company Division in Atrium - IBM i, iSeries, AS400

While the company names and values are hard-coded in this example, it is also possible to load them dynamically by using an AJAX call (see and Universal Display Files (see

Please note, the dropdown box has been assigned the id of “companyNumber” by the JavaScript code.

Passing the company to a Genie Macro

When adding a Genie Macro action, you can now select a new data type when writing a value into a field. By selecting “The result of a JavaScript expression” for the data type, we can specify an expression that will retrieve the company number from the dropdown list and pass it to the macro.

The screenshot below illustrates this capability:


We hope you find this information useful! Try Atrium today at: You can learn more about Genie at:

Topics: Tips and Tricks

Subscribe to Blog Updates

....and get our "How to Get Full Business Buy-In for Your Modernization Project" ebook!

business buy-in ebook

Recent Posts