Movie Summary

RAMP-NL

Movie Summary


For movie Make Function Keys Go Somewhere Different - 4.5 minutes.

This movie shows how to automatically redisplay the Display Employee screen after the user has made a change and pressed Enter. It also shows how to hide function keys and buttons which are not required.

Automatically redisplay the screen

When the user edits an employee and presses Enter, they return to the Find Employee screen. We want to change this so that the Display Employee screen is redisplayed (this is how Windows typically works).

To redisplay the edit screen we locate the Button Script for the Display Employee destination and change it so that when the user presses Enter:

·         First we tell RAMP to press Enter to go to the Find Employee screen

·         Then we set the value of the employee code field on the Find Employee screen in the same way as in the previous tutorial

·         And then press Enter to go to the Display Employees screen

·         Lastly to start edit mode we add a script instruction to press F21

This is the code:

... 

Case KeyEnter:

     SENDKEY(KeyEnter);

     SETVALUE("utxtEmployeeCode", objListManager.AKey1[0]);

     SENDKEY(KeyEnter);

     SENDKEY(KeyF21);

...

 

Hide function keys and buttons

We also hide most of the buttons that are displayed on Display Employee because they are not required:

·         Display the Destination Screen Details for Display Employee

·         Disable and hide all buttons except Enter

·         Change the caption of the Enter button to Save

Now save your changes and restart the Framework.

 

If you now change some employee details to valid values and press Save, the Display Employee screen is redisplayed.