Stop navigation to next record from blank record [message #399552] |
Wed, 22 April 2009 22:24 |
lakshmi173
Messages: 1 Registered: April 2009
|
Junior Member |
|
|
Hi,
I have a database block with 3 fields from a table. DML is allowed. The block also has a check box which is not from the table. If the user clicks on the next record (new) of the last record and select the check box and then click on its next record (2nd new) it allows to navigate. But the user should stay in the 1st new record until he enters data in atleast one of the 3 fields. He can navigate to previous existing records. I wrote the following code in WHEN-VALIDATE-RECORD of the block. If I raise form_trigger_failure here, the user will not be able to move anywhere even to previous records.
IF :block.field1 IS NULL
AND :block.field1 IS NULL
AND :block.field1 IS NULL
THEN
:block.check_flg:='N';
Set_Record_Property(:system.cursor_record, 'BLOCK', STATUS, NEW_STATUS);
END IF;
I wrote the following code also in KEY-NXTREC and KEY-DOWN, but it allows the user to navigate to next record using the mouse.
IF :block.field1 IS NULL
AND :block.field1 IS NULL
AND :block.field1 IS NULL
THEN
message ('Record must be entered or deleted first.');
RAISE form_trigger_failure;
END IF;
Please help me. Thank you.
|
|
|
|