Re: developer 2000 save block changes
From: Kirill Dylewski <k.dylevsky_at_globalone.ru>
Date: Fri, 31 Mar 2000 09:28:28 +0400
Message-ID: <38e43681$1_at_news1.rosprint.net>
....
....
Date: Fri, 31 Mar 2000 09:28:28 +0400
Message-ID: <38e43681$1_at_news1.rosprint.net>
I had the same problem (Forms 5). Here is my solution.
This is part of CLEAR_ALL_MASTER_DETAILS_PROCEDURE procedure, which Forms
generates when you use master/details
....
IF frmstat = 'CHANGED' THEN
curblk := First_Changed_Block_Below(mastblk);
--
-- If we find a changed block below, go there
-- and Ask to commit the changes.
--
IF curblk IS NOT NULL THEN
Go_Block(curblk);
Check_Package_Failure;
Clear_Block(ASK_COMMIT); -- This built-in displays message 'Do you
want to commit'
--
-- If user cancels commit dialog, raise error
--
IF NOT ( :System.Form_Status = 'QUERY'
OR :System.Block_Status = 'NEW' ) THEN
RAISE Form_Trigger_Failure;
END IF;
END IF;
....
I suggest to replace standart code with something like this:
....
IF frmstat = 'CHANGED' THEN
curblk := First_Changed_Block_Below(mastblk);
--
-- If we find a changed block below, go there
-- post changes, and set form-level flag that changes was made.
--
IF curblk IS NOT NULL THEN
Go_Block(curblk);
Check_Package_Failure;
Clear_Block(NO_COMMIT);
/*
I place :changes in non-database block, default value is NULL
Before exiting form I check :changes value and execute
COMMIT_FORM if necessary
*/
:changes:='YES';
POST;
END IF;
....
Hope this helps
Good luck, Kirill
Received on Fri Mar 31 2000 - 07:28:28 CEST
