Re: Forms 5 block synchro question

From: Kirill Dylewski <k.dylevsky_at_globalone.ru>
Date: Wed, 22 Mar 2000 18:45:14 +0300
Message-ID: <38d8e9d0_at_news1.rosprint.net>


Hi, Johan

I had the same problem. 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 Wed Mar 22 2000 - 16:45:14 CET

Original text of this message