Reading values

Scripts can read values from the instance list like this:

     myVariable = objListManager.Akey3[0];

See Visual and Programmatic Identifiers.

If the user has selected several entries in the instance list, you can read all the values in a loop like this:

     var i = 0;
var strMessage = "";
for (i = 1; i <= objListManager.TotalSelected; i++)
{
    strMessage += "Selected Employee " + objListManager.AKey3[i] + " ";
}
alert(strMessage);

Or from a field defined on a 5250 screen like this:

     MyVariable = GETVALUE("utxtEmployeeCode");

Writing values

The script can put values on the screen like this:

     SETVALUE("utxtEmployeeCode", "myText");

Storing values

You can store values in Javascript variables and then read and write from them:

     Var MyString = "";
MyString = objListManager.Akey3[0];

These variables exist only while the script is running. To share information between scripts, you need to create and set a property for objGlobal :

     objGlobal.uLastValue = "anything";

Then another script can read this value:

     myVariable = objGlobal.uLastValue;

Getting script pieces quickly

Using the Scripting Pop-up Menu

  • No labels