Friday, January 13, 2012

New Lawson S3 Technology Blog

There's a new Lawson S3 Technology Blog at  As there is lots of technology (like LSO, PFI and LBI) shared between S3 and M3 this may be an interesting blog to follow for M3 users as well.

Note that the blog has now moved to Infor's site

Tuesday, January 10, 2012

JScripts and toolbox programs

Thibaud has posted a entry on how JScripts that can be programmed to be generic across multiple screens.  This reminded me of a solution I've used for dealing with M3 toolbox screens where the columns can change based on the panel version selected by the user.

Columns in LSO can be queried by looking at the controller.RenderEngine.ListControl.Columns list.  The following JScript parses through the list of columns (in my case in mms080) to find the columns that store the ORCA (order category) and RIDN (order number) columns.

   var category_column = 100;
   var orderno_column = 100;
   var listControl = controller.RenderEngine.ListControl;
   var columns = listControl.Columns;
   for(var i=0; i < columns.Count; i++) {
      if(columns[i] == "ORCA") { category_column = i;}
      if(columns[i] == "RIDN") { orderno_column = i;}

From there I can check to see if I have the columns I need to run my JScript logic, and if I do not then advise the user accordingly.

   if (qty_column != 100 && category_column != 100') {
      //apply logic
   } else {
      //advise the user that we don't have the required information to run the script

This approach allows robust JScripts that work with user-configurable toolbox screens.

Saturday, January 7, 2012

Screen design changes using JScript

I continue to be impressed with what can be achieved with JScript and LSO. The other day I wanted to improve the readability of a screen. Using personalisations I hid unnecessary fields, but I was then left with fields scattered across a screen that I wanted to group together. JScript allows me to find controls on the screen and move these around with the Grid.SetColumn and Grid.SetRow functions:

import System;
import System.Windows;
import System.Windows.Controls;
import MForms;

package MForms.JScript {
   class MMS001_ChangeItemFieldPos {
      public function Init(element: Object, args: Object, controller : Object, debug : Object) {
         var content : Object = controller.RenderEngine.Content;

         //Find the control we want to move
         var textBoxItem = ScriptUtil.FindChild(content, "MMITNO");

         //Specify where we want to move the control to
         Grid.SetColumn(textBoxItem, 50);
         Grid.SetRow(textBoxItem, 1);

Prior to running this script the screen looks like this:

After running the script the Item number field has been moved:

Combined with the ability to set the Tab Order in LSO we're able to create streamlined panels that show just the information we're interested in, and group them together into business or user-specific groupings.