Movie Summary

RAMP-NL

Movie Summary


For movie Handle Unexpected Stops in Navigation and Messages - 3 minutes.

This movie shows how to handle unexpected stops in the navigation and how to issue messages.

Handle unexpected stops

If the employee details entered by the user are invalid, the user stays on the Display Employee screen instead of going to the Find Employee screen, and consequently our script instructions for handling the Enter key will be wrong.

We need to change the script so that if it detects that the user did not get to the Find Employee screen, it stops and takes no further action. To do this:

Go to the Button Script for the uDisplayEmployee Destinations and locate the SENDKEY(EnterKey) statement which takes us to the Find Employee screen.

Add this line under the SENDKEY statement to check if we actually got to the Find Employee screen and to end the script with a return if we did not:

 

if ( CURRENT_FORM() != "uFindEmployee" ) return;

 

 

Issue a message

If we get past this line, we can assume that the employee details were successfully saved and issue a message. To do this add this line after the if statement:

 

ALERT_MESSAGE("Employee ", objListManager.AKey1[0] , " has been saved.");

 

Commit your script changes and then save and restart the Framework.

Now, if we attempt to save an employee with invalid data, the script stops and the Display Employee screen is redisplayed.

If we abandon changes for that employee, click on another employee and successfully save the details, we get the message we created and the script continues on around to the Display Employee screen again.