Re: ASK FOR COMMIT BEFORE LEAVING A RECORD INSTANCE.
Date: Mon, 27 Sep 1999 10:33:48 +0200
Message-ID: <37EF2BEC.8F7FE66_at_theleme.com>
Forms 4.5 runs a default alert message whenever you change focus, depending the
form validation unit.
By example if you specify validation unit as record an alert will be displayed
every time you navigate from a changed record to another.
I suggest you trap post-record event:
Assume you create an Alert COMMIT_ALERT with button 1 YES and button2 NO.
TRIGGER POST-RECORD: (at form level if available for any record)
declare
answer number;
begin
- Get leaving record status
- QUERY means no changes and NEW means records has just been created and will be canceled if you leave it
- CHANGED means you modify a queried record
- INSERT means you enter values in a a just created record
if :system.record_status in ('CHANGED','INSERT')
then
answer := Show_Alert('COMMIT_ALERT');
if answer := ALERT_BUTTON2
then
[Quoted] raise form_trigger_failure; -- Cause navigation failure;
end if;
end if;
end;
- BEWARE: post_record trigger is only fire if form's validation unit is item or record ! ***
Well, I hope this will help you.
Yann.
"Olivier Régis" a écrit :
> I WANT A DIALOG "DO YOU WANT TO COMMIT ?" (YES/NO)
> IF I ANSWER (NO), IT MUST NOT LEAVE THE CURRENT RECORD.
> I WANT THIS EVERYTIME THERE'S A CHANGE IN A RECORD AND I LEAVE A RECORD. IN
> A MASTER-DETAIL, IT MUST WORK ALSO WHEN I LEAVE A MASTER RECORD TO GO TO A
> DETAIL RECORD..
>
> WHAT'S THE SIMPLEST SOLUTION AND TRIGGERS TO USE ?
>
> THANKS FOR THE ADVICE..
>
> O.Régis
> MCSE+I, OCP
Received on Mon Sep 27 1999 - 10:33:48 CEST