http://www.lansa.com Newsletter June 2006

LANSA version 11.3

Cumulative Update 3 (CU3) Information

CU3 is a cumulative set of changes for a range of LANSA features. It includes software to be installed on an iSeries machine and on a Windows machine.

CU3 provides a single install point for all features. So, although the software changes have been grouped for a product feature under an EPC number you do NOT need to directly invoke an EPC install.

See the epc77n.htm files for details of the changes delivered. CU3 comprises these individual EPCs: • epc770 - LANSA Communications • epc771 - Visual LANSA • epc772 - LANSA Integrator (only on CU3 install CD) • epc773 - LANSA Web Utilities • epc774 - LANSA Web Server • epc775 - LANSA Open • epc776 - Visual LANSA Frameworks

CU3 is distributed by CD-ROM or a Zip File that can be downloaded.

LANSA version 11.3 page 1 Compile error RDMLX objecten page 10 In LANSA and V5R4 page 2 PrintScreen functionality in VL page 11 CGIConvMode Setting and L4Web page 3 Crash WAM on HP Notebook page 15 This Advanced Enter key in VL page 4 Cannot start VL on Server PC page 17 VLF Web with IE7 beta page 6 Using the PDFSpoolFileService page 18 Issue VLF demo before CU3 page 7 VLF: What’s new in CU3 page 19

LANSA Newsletter June 2006 page 1 © LANSA 2006

LANSA and V5R4

Description IBM’s latest release of i5/, V5R4 was made generally available on February 14th. This version of OS/400 is listed in the V11.0 Supported Platforms document as Confirmed. Refer to Supported Platforms : http://www.lansa.com/support/v11news/supportedversions.htm

LANSA actively participated in the V5R4 beta program and conducted LANSA V11.0 testing on this version. LANSA's V11.0 testing of the entire LANSA suite of products on V5R4 did not highlight any issues that require correcting.

One issue has been reported when using SSL in LANSA for the web on V5R4. However, this issue has been corrected via an IBM PTF. Refer to CGIConvMode setting causes various issues for LANSA for the Web on V5R4 : http://www.lansa.com/support/notes/p0281.htm

Unless stated otherwise in the LANSA V11.0 What’s New or Online documentation, existing unsupported OS/400 features remain at the same status. Refer to Features in OS/400 that are not supported in the current versions of LANSA : http://www.lansa.com/support/tips/t0152.htm

LANSA Newsletter June 2006 page 2 © LANSA 2006

CGIConvMode setting on V5R4 causes various issues for LANSA for the Web

Description The CGIConvMode setting on V5R4 causes problems for LANSA for the web applications. If the CGIConvMode setting is %%MIXED/MIXED%%, the following 2 issues can be generated: 1. Certain character, for example "(" and "'" (single quote) can be mis-interpreted and returned as "" and "}" respectively on the web browser. 2. SSL does not work properly in your LANSA for the web application. Possible error message would be: EBCDIC_to_UTF8(): Exception MCH1235 occurred while converting TRACE DATA to the job CCSID. Value 0 for CCSID not valid.

In the short term, these problems can be circumvented by either commenting out the %MIXED/MIXED% directive or changing the directive to %EBCDIC/MIXED%

IBM has produced a PTF to resolve issues introduced by have the CGIConvMode set to %MIXED/MIXED%. Refer to http://www- 912.ibm.com/a_dir/as4ptf.nsf/0/626a4f73de446c0b86257114005db5ae?OpenDocument

LANSA Newsletter June 2006 page 3 © LANSA 2006

Advanced Enter Key Handling in VL applications

The enter key is often used to indicate the initiation of some activity (eg: to perform a search, to save an update, etc) in VL applications.

Typically the ButtonDefault() property is used on push buttons such as “Search” or “Save” so that the enter key causes a virtual click event to be issued against the button.

In complex VL forms containing many different reusable parts the use of the ButtonDefault() property may become problematic for two reasons:

1. Only a single button can be the default at any point in time on a Windows form.

2. There is no ability to use program logic to decide what the enter key actually means and how it should be handled in different contexts.

The most powerful solution to handling the enter key differently in different places on complex forms is be solved by using the KeyPress event. This allows the VL program to specifically trap the enter key and then respond to it in different ways.

Consider the following modifications made to the logic in the filter DF_FILT1 example shipped with the VLF.

1. No button has ButtonDefault() specified This prevents any confusion about which button the enter key should be directed to.

2. The user may initiate an Employee name search in 2 ways

Evtroutine Handling(#Surname.KeyPress) Keycode(#KeyCode)

if ('#KeyCode.Value = Enter') If *SEARCHOK Execute Search Else Use Message_box_show (ok ok Error *Component 'Enter a search name') Endif Endif

Endroutine

* Search button pressed *

Evtroutine Handling(#Search_phbn.Click)

Execute Search

Endroutine

LANSA Newsletter June 2006 page 4 © LANSA 2006

The first event routine handles the use of the enter key within the Surname field. If the user presses enter then either a search is performed or an error message is displayed (Condition *SEARCHOK is true if field #Surname is non-blank).

The second routine handles a specific click of the Search button.

Both routines share a common SEARCH subroutine to perform the search logic.

Note that where multiple fields (or other visual controls) are used you can handle them all through a single routine like this:

Evtroutine Handling(#Surname.KeyPress #GiveName.KeyPress #ComboBox1.KeyPress etc etc) Keycode(#KeyCode)

LANSA Newsletter June 2006 page 5 © LANSA 2006

Using VLF Web applications with IE7 beta

How can I enable the Visual LANSA Framework to execute as a Web application in I.E. 7 Beta 2?

Microsoft recently released the latest beta version of IE7.0. See http://www.microsoft.com/windows/ie/default.mspx If you want to use this IE beta version with VLF-WEB applications you need to do the following:

To immediately enable any already deployed VLF-WEB applications • Modify any existing NNNNNNNNNNNN_LLLL_SSS.htm startup files (eg: VF_SY001_System_ENG_XP.HTM) on the HTTP server (where LLLL is the language code and SSS is WEB, XP, or WIN). NOTE: Unless you complete the next step this change is only effective until the next time the framework design is saved or deployed by a developer. • Make a backup copy of the file. • Open the file for editing • Locate the line 'else if (navigator.appMinorVersion.indexOf("SP3") >= 0) __strAppVersion__ = "6+";' • After this line add the line 'else if (navigator.appMinorVersion.indexOf("Beta 2") >= 0) __strAppVersion__ = "6+";' • Save the changes.

To change the way that any new nnnnnnnnnnnn_LLLL_SSS.htm startup files are generated by developers • Modify the developers skeleton file VF_SY004_1.dat. • Locate the VF_SY004_1.dat file in the partition execute directory of the development system. • Make a backup copy of the file. • Open the file for editing. • Locate the line 'else if (navigator.appMinorVersion.indexOf("SP3") >= 0) __strAppVersion__ = "6+";' • After this line add the line 'else if (navigator.appMinorVersion.indexOf("Beta 2") >= 0) __strAppVersion__ = "6+";' • Save the changes. • Make a change to the framework design and save it. The startup file will be regenerated and copied to the HTTP server.

LANSA Newsletter June 2006 page 6 © LANSA 2006

The VLF Demonstration and Programming Examples - before CU3

Until LANSA CU3, VLF upgrades always renamed and then replaced the standard shipped demonstration system in XML file VF_SY001_System.XML with the very latest shipped demonstration version. This was done to make sure everybody got to view and use the latest demonstration and programming techniques material.

This upgrade approach tended to alarm people who had been putting there own VLF applications into VF_SY001_System.XML.

Typically they did not read the upgrade notes or look in the online guide and instead contacted LANSA support in a panic, thinking that their own VLF changes had been lost. They were then directed to the guide and the problem was quickly resolved.

This was a waste of everybody's time and the cause of needless angst.

The VLF Demonstration and Programming Examples - after CU3 An existing VF_SY001_System.XML file is no longer renamed and replaced by a VLF upgrade.

If it already exists it is left unchanged and the new shipped latest version is installed with the name VF_Sy001_System_LastShipped.XML instead.

Sounds like a solution that makes everybody happier?

Not quite....

So what's the downside to doing this? When a user starts the VLF in an upgraded system they now use the same VF_SY001_System.XML file as they were using before the upgrade. They are using an "old" version that contains the "old" definitions of the demonstration and programming examples.

There are two significant downsides to this:

1. Developers may not get to view and use the latest demonstration and programming examples because they are not defined in their "old" VF_SY001_System.XML.

2. There may be incompatibilities between the newly upgraded demonstration filters and command handler programs and what is defined in their "old" VF_SY001_System.XML.

LANSA Newsletter June 2006 page 7 © LANSA 2006

An example of (1) is the new "Advanced Instance List" examples. These are new to the CU3 version of the VLF. If you use an "old" version of VF_SY001_System.XML you will not see them and may never know they exist.

An example of (2) relates to the shipped example EMPLOYEE and SECTIONS business objects. In the CU3 version of the VLF the instance lists and relationships for EMPLOYEE and SECTIONS were significantly changed to demonstrate the new parent/child type relationships.

So if you start the demonstration system using an "old" version of VF_SY001_System.XML and execute the updated EMPLOYEE or SECTIONS business object filters or command handler programs, then you might see errors like:

'Invalid business object user name/type SECTIONS encountered in instance list". 'Invalid or Unknown user object EMPLOYEE encountered in instance list".

This is because the CU3 updated demonstration filters and command handler programs are pumping out instance list data in the "new" parent-child format .... but the "old" framework definition in VF_SY001_System.XML does not have these relationships defined ..... so it gets confused and starts issuing warning messages.

LANSA Newsletter June 2006 page 8 © LANSA 2006

How to rectify this? The easiest way to rectify this, if you have nothing of real value defined in your "old" VF_SY001_System.XML file, is simple:

1. Locate VF_SY001_System.XML in your partition execute directory and delete it. 2. Locate VF_Sy001_System_LastShipped.XML in the same directory and rename to VF_SY001_System.XML . 3. Start the framework. You should now have the latest demonstration and programming techniques available and no warning messages should appear.

If you do have valuable things in your "old" VF_SY001_System.XML file that you need to keep then do the following:

1. Start the framework as a designer and make a dummy change to a business object caption (say). Use the new (Framework) -> (Save As) option and save VF_SY001_System.XML using a different file name (eg: My_System.XML ). Close down the framework. 2. Check that XML file My_System.XML (say) has been created in your partition execute directory. 3. Locate VF_SY001_System.XML in your partition execute directory and delete it. 4. Locate VF_Sy001_System_LastShipped.XML in the same directory and rename to VF_SY001_System.XML . 5. Start the framework again. You should now be able to choose between starting VF_SY001_System.XML or My_System.XML . 6. Start VF_SY001_System.XML . You should now have access to the latest demonstration and programming techniques material and no warning messages should appear. 7. Start My_System.XML. Delete the demonstration and programming techniques applications from My_System.XML, leaving just your own application parts ready for further work.

LANSA Newsletter June 2006 page 9 © LANSA 2006

Compile failure when compiling RDMLX objects & WAMs with error MCH3203 in joblogs

Description

Compilations on iSeries can fail with the following error in the joblog:

MCH3203 Escape 60 10/04/06 14:13:04.283127 VOXALIAS 004C1C QBNCRTMD QSYS *STMT From user ...... : O_LANSA05 To module ...... : QBNCRTMD To procedure ...... : main_module Statement ...... : 1038 Message . . . . : Function error in machine instruction. Internal dump identifier (ID) . Cause . . . . . : The machine instruction that was running failed. Time stamp is , error code is , error class is , device number is . The error class indicates how the damage was detected: 0000-unspecified abnormal condition; 0002-logically invalid device sector; 0003-device failure. For error class 0003, the device number identifies the failing device, or contains zero if main storage failed. Recovery . . . : Start problem analysis (ANZPRB command).

The most likely scenario to generate this error is when checking in and compiling a WAM (or other RDMLX object). The failure within the compiler may have to do with the size of the WAM in terms of the generated C. Hence, it is more likely to occur in large and complex WAMs with many webroutines.

Resolution

This is caused by an IBM compiler issue which may occur when compiling some modules with optimization levels 20, 30, 40 and a fix is available via PTF. Refer to the following PTF cover letter for detailed information:

MSGMCH3203 if program compiled with CRTCMOD OPTIMIZE(40)

Refer to http://www-912.ibm.com/n_dir/nas4apar.nsf/ALLAPARS/MA33367

This PTF will need to be applied to resolve the issue.

Note: If observable information has been removed from the affected object, the customer can circumvent the problem by compiling the program source code with optimization level *NONE or 10.

LANSA Newsletter June 2006 page 10 © LANSA 2006

PrintScreen functionality in VL

The PrintScreen functionality is not related to the printer functions of a PC; it emulates the function of the Print Screen key on your keyboard (sometimes shortened to PrtScr). Basically it will capture an image of your current screen and save it to a file (PrintScreen button only saves it to the clipboard).

There are two methods that have been added in the CU3 software of LANSA: • #Sys_Appln.CaptureDesktop( #FileName ) This will capture a screenshot of your entire desktop including the task bar. It will be saved as a BMP file to the filename specified in the parameter.

LANSA Newsletter June 2006 page 11 © LANSA 2006

• #Sys_Appln.CaptureWindow( #FileName #Control ) This will capture a screenshot of the active window only, or if the optional parameter #Control is specified, it will capture only the contents of that control.

To demonstrate the controls you can use the following code: Function Options(*DIRECT) Begin_Com Role(*EXTENDS #PRIM_FORM) Caption('Capture Screen') Clientheight(532) Clientwidth(567) Componentversion(1) Formposition(ScreenCenter) Framestyle(Dialog) Height(586) Layoutmanager(#ATLM_1) Left(204) Menubar(#MBAR_1) Top(149) Width(575) * Menu definition Define_Com Class(#PRIM_MBAR) Name(#MBAR_1) Parent(#COM_OWNER) Define_Com Class(#PRIM_MITM) Name(#MITM_1) Caption('File') Displayposition(1) Parent(#MBAR_1) Define_Com Class(#PRIM_SMNU) Name(#SMNU_1) Parent(#MITM_1) Define_Com Class(#PRIM_MITM) Name(#MITM_SCREEN) Caption('Capture Desktop') Displayposition(1) Parent(#SMNU_1) Define_Com Class(#PRIM_MITM) Name(#MITM_ACTIVE) Caption('Wait 5 seconds and capture Active window') Displayposition(2) Parent(#SMNU_1) Define_Com Class(#PRIM_MITM) Name(#MITM_TAB) Caption('Capture Tab contents') Displayposition(3) Parent(#SMNU_1)

LANSA Newsletter June 2006 page 12 © LANSA 2006

* File name edit Define_Com Class(#STD_TEXT.Visual) Name(#STD_TEXT) Caption('File name') Displayposition(1) Height(19) Labeltype(Caption) Left(8) Marginleft(75) Parent(#COM_OWNER) Tabposition(1) Top(12) Usepicklist(False) Width(313) * Timer for active window capture delay Define_Com Class(#prim_timr) Name(#timer) Interval(5000) * Tab, Sheets and Contents for SYS_APPL.CaptureScreen Control testing Define_Com Class(#PRIM_TAB) Name(#TAB_1) Displayposition(2) Height(463) Left(0) Parent(#COM_OWNER) Tabposition(2) Top(69) Width(567) Define_Com Class(#PRIM_IMGE) Name(#IMAGE) Displayposition(1) Height(437) Left(0) Parent(#TBSH_RESULT) Tabposition(1) Top(0) Width(559) Define_Com Class(#PRIM_TBSH) Name(#TBSH_RESULT) Caption('Results') Displayposition(1) Height(437) Layoutmanager(#ATLM_1) Left(4) Parent(#TAB_1) Tabposition(1) Tabstop(False) Top(22) Width(559)

* Form Layout Define_Com Class(#PRIM_ATLM) Name(#ATLM_1) Define_Com Class(#PRIM_ATLI) Name(#ATLI_1) Attachment(Center) Manage(#IMAGE) Parent(#ATLM_1) Define_Com Class(#PRIM_ATLI) Name(#ATLI_2) Attachment(Bottom) Manage(#TAB_1) Parent(#ATLM_1)

Evtroutine Handling(#MITM_SCREEN.Click) * Capture the screen #sys_appln.capturedesktop( #std_text ) * Update image #IMAGE.filename := "" #IMAGE.filename := #std_text Endroutine

Evtroutine Handling(#MITM_ACTIVE.Click) * Start timer (will tick 5 seconds later and capture the active window ) #timer.start Endroutine

Evtroutine Handling(#MITM_TAB.Click) * Capture the sheet contents #sys_appln.capturewindow( #std_text #TAB_1 ) * Update image #IMAGE.filename := "" #IMAGE.filename := #std_text Endroutine

Evtroutine Handling(#COM_OWNER.CreateInstance) Options(*NOCLEARMESSAGES *NOCLEARERRORS) * Initialize form #IMAGE.filename := "" #std_text := "c:\Bitmap.bmp" #timer.stop Endroutine

Evtroutine Handling(#timer.Tick) Options(*NOCLEARMESSAGES *NOCLEARERRORS) * Stop the timer #timer.stop * Capture the foreground window #sys_appln.capturewindow( #std_text ) * Update image

LANSA Newsletter June 2006 page 13 © LANSA 2006

#IMAGE.filename := "" #IMAGE.filename := #std_text Endroutine End_Com

You do not need any special hardware/software to take advantage of this feature. And if you want to add the functionality to existing applications then yes it requires a recompile (since you will be adding extra code).

LANSA Newsletter June 2006 page 14 © LANSA 2006

Invoking a WAM may cause Internet Explorer to crash on certain HP/Compaq Notebook and Tablet PCs

Description On some HP/Compaq notebook and tablet PCs where HP Credential Manager for ProtectTools is installed, invoking even the most simple WAM in Internet Explorer will cause IE to crash with the following screen:

The error report indicates that the problem occurred in jscript.dll:

The WAM runs correctly in the Preview Window of the XSL Editor and (within functional limits) in other browsers such as Mozilla Firefox.

LANSA Newsletter June 2006 page 15 © LANSA 2006

Cause

The cause of this issue has been traced down to an add-on to Internet Explorer which is installed by HP Credential Manager for ProtectTools. This add-on is known to conflict with certain web pages. There are reports of similar problems with web servers such as Microsoft Sharepoint Portal Server.

Resolution

Disabling the HP Credential Manager add-on in Internet Explorer resolves the issue. To do this you can use the following steps:

1. Start Internet Explorer

2. Select Manage Add-ons from the Tools menu

3. In the Manage Add-ons dialog, click on HP Credential Manager for ProtectTools and then click Disable . Confirm your selection if asked.

4. You may need to close all instances of Internet Explorer and restart for the change to take effect.

LANSA Newsletter June 2006 page 16 © LANSA 2006

Cannot start Visual LANSA on Server PC due to disabled Terminal Services service

Description Starting Visual LANSA on a server PC (in a Slave Server/Network Client) development environment can fail with the following error

LIIO525S Error encountered while calling function Obtail current session user name. Return code = 1702

This message is generated when the Terminal Services service is disabled on the server PC. Not having the Terminal Services service enabled on a server PC is more common in Windows 2003 or with the latest Windows service packs, which disable the service for security reasons.

Correction Enabling the service will allow you to successfully log into visual LANSA on the server PC. Visual LANSA V11.0 will be changed so that this service does not have to be enabled in order to log into Visual LANSA.

LANSA Newsletter June 2006 page 17 © LANSA 2006

Special characters not appearing when using the PDFSpoolFileService to convert spool files into a PDF document

Description When using the PDFSpoolFileService to read and convert a spool file from the iSeries, certain characters are not getting translated properly. For instance characters such as é à è.

Solution You need to use ENCODING (Cp850) on the CREATE command, ie CREATE DOCUMENT ( ... ) .... ENCODING ( Cp850 ). Refer to the LANSA Integrator guide for the section titled CREATE for details on specifying an encoding value.

Various additional information:

The PDFSpoolFileService uses IBM Java Toolkit which uses Host Print Transform. When Host Print Transform converts from EBCDIC to ASCII it uses ASCII 850. http://publib.boulder.ibm.com/iseries/v5r2/ic2924/books/c415713521.htm

Specify 850 as the Printer Character Set Selection.

This document provides instructions for using your own translation table for converting USA/Canada EBCDIC to ASCII when using Host Print Transform (HPT). This is done by retrieving and modifying a Workstation Customization Table (WSCST) and changing the values in the Overriding the Default ASCII Code Page (DFTASCP) and EBCDIC-to-ASCII Table Entry (EBCASCTBLE) tags.

======MS Windows uses codepage 1252 MS DOS under windows uses codepage 850 http://www.microsoft.com/globaldev/reference/oem/850.mspx

LANSA Newsletter June 2006 page 18 © LANSA 2006

VLF: What’s new in CU3

1. Advanced Instance Lists • Instance Lists with Many Types of Objects You can define parent-child and peer-to-peer relationships between business objects in order to include Different Types of Objects in the Instance List.

2. Programming • Button to Verify an Object Exists You can check that your object names are unique using the Verify Name button for the User Object Type property.

LANSA Newsletter June 2006 page 19 © LANSA 2006

• Automatic Handling of Unsaved Changes The Framework manager provides a locking service that signals there are unsaved changes in a command handler or filter, and locks the Framework until the user has taken action to accept or cancel the changes.

A simple example of the use of a Framework lock is where a business object's details have been changed and the user then clicks on another instance of the same business object or invokes any other action in the Framework that would cause the changed details to be lost.

You can use the service to notify the user about unsaved changes and to lock the Framework when the business objects details change. A message is issued and the user has the choice of returning to the business object details to save them or continue with the requested action:

See the employee details command handler, DF_DET1, and the section details command handler, DF_DET8, for complete examples of the use of the Framework locking service in windows applications.

LANSA Newsletter June 2006 page 20 © LANSA 2006

Framework locking is implemented through two Framework properties that are exposed to filters and command handlers, uLocked and uLockedMessage .

Values are FALSE, USER or PROGRAM.

USER means that the Framework is locked, but that the user can uLocked select to end the lock.

PROGRAM means that the Framework is locked and only a program can unlock it by setting this property to FALSE.

uLockedMessag This is the message to be shown to the user if they attempt to do e something that would violate the lock state.

For example you could put this code in the Changed event of fields on a command handler to lock the Framework until the user has saved changes:

Set #avFrameworkManager uLocked(USER) uLockedMessage('Details for the current Employee not saved. Would you like to return to the details command to save.')

3. Look and Feel • XP-Style Tab folders New style Stacked is available for the Command Tab Style property to enable XP-like tab folders.

LANSA Newsletter June 2006 page 21 © LANSA 2006

4. Performance • Quick Updating of Instance Lists Instance list updating can be speeded up using new method UpdateListEntryData. For information, refer to Filters and List Manager

5. Things that Speed Up Your Work • Instant Prototyping Wizard You can define an entire application very quickly using the new Instant Prototyping Wizard. The Wizard is displayed when you create a new application or business object. You can also start it from the Framework menu.

• New Coding Assistants New Program Coding Assistants are available to help you quickly generate the code for your filters and command handlers.

LANSA Newsletter June 2006 page 22 © LANSA 2006

6. Security • Importing Users to the Framework You can automatically import users to the Framework using a reusable part specified in the Import Users Imbedded Interface Point property.

7. Web • Improve Performance by Transforming XML to HTML on Client Browser XML to HTML transformations can optionally be performed on the client browser for more effective resource utilization. See Use Client Side XML->HTML Transforms for more information.

• Activating Field Help for WAMs To activate end-user help for fields on WAMs you can add a new start option, WAMHelp=Y, to the URL for a Web Browser Framework Application. See Web Application Start Options and Help Text for Web Applications for more details.

LANSA Newsletter June 2006 page 23 © LANSA 2006

8. Fast Parts • Message Box Fast Part The Message Box fast part shows messages in a Windows-like message box in web applications.

• HTML Fast Part The HTML fast part allows you to display your own HTML in the fast part. The RDML function that displays FP_RHTML loads the HTML to be displayed into FP_RHTML, at run time.

9. Framework Versioning • Saving Versions of the Framework You can now save different versions of the Framework using the Save As... option of the Framework menu:

The next time you start up the Framework you can choose which version you want to work with:

For more information, see “Several Designers and Developers Working on the Same Application” in the VLF Guide.

LANSA Newsletter June 2006 page 24 © LANSA 2006