Example: Creating a Button Group |
The button group at the bottom of the Reservations info window has the following functionality: •If the user clicks the Add Person Booking button, a default entry should be made for the person booking (RESERVATION.MADE_BY) in the PARTICIPANT table and this entry should also appear in the related Participants box in the Reservations window. •If the user clicks the Cancel Reservation button, the reservation should be canceled. A reservation is canceled if it has a CANCEL_DATE value. •If the user clicks the Quote Final Price button, this should result in a price (re)calculation taking into account the current record, but it should not result in commit. •If the user clicks the Confirm Reservation button, the transaction should be committed. To create a Button Class for the button group:
To create the button group:
To give the button group a better layout:
To give the buttons the correct behavior:
SqlScript(insert into participant(person_id, res_id, insurance) values(:MADE_BY, :RES_ID, 'N')) Participants_taking_part_in_Reservation.QueryExecute() Participants_taking_part_in_Reservation.person_id.esd_int.ControlSetFocus()
ActionDecision(CANCEL_RES) RecordStore('QUIET') In the CANCEL_RES decision, set Decision SQL to: SELECT SYSDATE and the Decision Yes Action to: query.cancel_date(:1)
Participants_taking_part_in_Reservation.RecordStore('QUIET'))
DataCommit() |