Building a Host Transaction Macro

The Host Transaction macro contains just the recording of the sample transaction. This macro is linked to the Host Screen macro so when called it can determine the navigation steps. Under the Transactions section create a new macro, give it a name and description, select Host Transaction macro type and link it to the Host Screen macro previously recorded.

Click the first toolbar button above the parameter grid to navigate the host screen to the correct location.

Next click the second toolbar button to mark all the fields on the screen that will be required for data entry.

Finally click on the third toolbar button to record a sample transaction.

After recording and submitting the data there may be indicators that it was successful or possibly failed. In this case there is a Batch number generated if the submission was successful so I select the batch number area and right-click to add the GetText command. In the code I will make sure something is retrieved. If nothing is returned then the bottom of the screen will contain an error message and the same GetText command can be used at those coordinates to get the text and display it to the user in a message box.

After the recording there may be a need to clean up the code if extra keystrokes were used and not necessary.

Notice that there are several tab keystrokes but the SendTextAlt command references X,Y coordinates. This makes all the tab characters unnecessary and worth deleting.

Now click on the Play toolbar icon to test the complete data entry portion of the macro assuming you can continue to reuse the same sample data.

Save and exit the Transaction Macro design screen. The last step is to create an application that links to this macro.

Creating a new application and linking it to the data entry macro provides all the marked fields in the toolbox window. Drag them on to the screen, save the application, place the new application on a menu and test the result. Set the host screen itself either to the main menu or the login screen to test all macros working together.

This application does not require any VBA scripting because the macros recorded all the steps. There is the option of taking the code out of the macros and placing them directly in the application itself if more direct control is required. An example might be the login screen on the host requires named used instead of a generic user. In this case the recording can be taken and placed in the RFLogin form. However in doing so the Host Screen macro does not have a Start Menu macro to rely on so the Host Screen and Host Transaction macro code would need to be placed in the application itself and the macros deleted.