######################################################################
# This response will be triggered when the user clicks on the Edit_PB
# in List_DB.
######################################################################
response to Edit_PB in List_DB
# Loop through all names selected in the List_TBL. If none are
# selected display a message indicating at least one line should be
# selected.
for each selected row Count_LIV of List_TBL loop
if (Count_LIV = 0) then
copy "You must select a staff record before viewing or updating." to Dummy_SV
# Call the user written subroutine ChangeMessage to display an error
# message back to the user indicating what they have done wrong.
call ChangeMessage(Dummy_SV)
# If a line is selected copy the NAME and corresponding ID to the
# ESL variables NAME_SV and ID_IV.
else
copy cell column 1 of row Count_LIV of List_TBL to NAME_SV
copy cell column 2 of row Count_LIV of List_TBL to ID_IV
# Execute the DB/Assist generated action routine to execute the
# select statement.
action EXECUTE_SelectStaffID
# If the EDB2Error_BV is false call action SetUpEdit_DB. This user
# written action routine will update the Edit_DB according to any
# changes made to the previous employee record.
if not(EDB2Error_BV) then
action SetupEdit_DB
# If the EDB2Error_BV is true call an action routine to display the
# error to the user. Action DisplayError can be any user written
# action routine which can display the appropriate error information
# to the user.
else
action DisplayError
end if
end if
end loop