Building a Screen Mapping Application

Once the recorded macros are built, there are two ways they can be implemented.

Create an application with data fields, collect and validate the data and use the Embedded Procedure object to pass that data to the Host Screen macro. (In the code window there is a right-click option to insert embedded code. Select Transaction Macros as the data source and then pick the appropriate Host Screen macro. See the Embedded Procedure section for more details.) The macro passes back either a True or False (based on setting the function name “Transaction” equal to one value), indicating the success or failure of the macro to complete its script. Alter the Host Screen macro’s script to send back an appropriate Boolean value. This method isolates the code responsible for interacting with the host system which is ideal for version control and frequent updates to application code unrelated to the host system.

Take the code generated in the macro and place it in the application itself. This gives the application total control and has another advantage. If the login screen is a host screen that must allow different user credentials, then the solution cannot rely on the automatic logging in and navigation to the main menu. An application can be created that collects the user credentials and screen maps the data to the host login screen. Having already recorded the macro, that code can be placed in the application directly and the macro may be deleted to avoid confusion. Taking this path requires that all applications be responsible for navigating and populating screens and fields on the host because the host is not automatically taken to a main menu, a generic starting point for the Host Screen macros. Since the Host Screen macros are linked to a Start Menu macro and they have been replaced by an application that performs that task after a custom login, Host Screen macros will not work. The solution is to create a Transaction macro with the same code, since it does not rely on links to previous macros.