Oracle Forms - Detail block clears on enter query

I have an Oracle Forms riddle for you.

I have a master and detail block. When I make a change in the master block and then press enter-query, I get prompted to save changes, but not before the detail block clears!  The detail block should only clear after I click yes or no.

I tried tinkering with the clear_all_master_details trigger but that doesn't seem to work.

I'm using Forms How to fix this problem?

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

The change you make is inserting a record, changing a record or deleting a record ?

I am familiar with forms up to Forms 10g but this does not sound as regular behaviour : search for 'CLEAR_BLOCK' in the PL/SQL-code  and check for the existence of a key-enter-query trigger.
Wasim Akram ShaikCommented:
--I'm using Forms How to fix this problem?

I don't think this is a problem, infact i believe this is a form functionality of Master-Child Relationship and it is a seeded functionality provided by oracle

The detail-block has to be cleared when you navigate to another master to "make place" for the details of that new master. So, if there are changes in the detail-block, forms asks the user what should happen with the changes.

above paragraph extract has been copied from question with some further questions/postings have been asked in this thread)
wasimibm : that is true for a change in the detail-record, but  leclaude changes the master block .
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

leclaudeAuthor Commented:
It is true that I'm in the master block and made changes there.

Going into more detail, here's what's happening in the clear_all_master_details procedure.  Here's the segment that clears the detail block:

        WHILE currel IS NOT NULL LOOP
          curdtl := Get_Relation_Property(currel, DETAIL_NAME);
          IF Get_Block_Property(curdtl, STATUS) <> 'NEW'  THEN
            IF :System.Block_Status <> 'NEW' THEN
              RAISE Form_Trigger_Failure;
            END IF;
          END IF;
          currel := Get_Relation_Property(currel, NEXT_MASTER_RELATION);
        END LOOP;

If I put this if-statement around clear_block:

if (:system.cursor_block != 'detail_block') then
end if;

Then the enter-query doesn't work at all, even though I'm in the detail block.  I put message statements there to confirm that I'm in the detail block.  I hit a dead end here.

I did however find a workaround so there's no urgency to fix this problem:  I modified the key-entqry on the master block to handle enter-query manually, and tweeked clear_all_master_details a bit.  It is a bit laborious and kludgy but it does the job.
Then the enter-query doesn't work at all, even though I'm in the detail block.  I put message statements there to confirm that I'm in the detail block.  I hit a dead end here.
If you skip the clear_block for the details-block and there are unchanged records in it the :system.block_status will be and stay  'QUERY' so the subsequent check on status 'NEW' will fail : form_trigger_failure wil be raised and your enter-query process stops :
 It should not be necessary to change  the clear_all_master_details : the procedure should't not be called in this situation (before asking for the commit).  

1) what happens if you do commit before the using enter-query ?
2) what was in the enter-query trigger before you handled it manually ?
3) where is the clear_all_master_details called ? (normally from the  on_clear_details -trigger)
leclaudeAuthor Commented:
1) If I do commit first then enter-query, then both master and detail blocks clear without a prompt, and then I'm in enter-query mode.

2) Prior to me entering the block-level key-entqry trigger, there was a form-level key-entqry trigger that set the toolbar buttons for enter-query mode and then called the enter_query built-in.  My block-level trigger eventually calls the same toolbar logic, but not before manually handling the enter-query functionality.

3) Yep, the on-clear-details trigger calls it.
Are those toolbar buttons  on the menu toolbar (thus part of a menu) or are those buttons  placed as a toolbar but build as items of a (different) forms block (thus part of the form) ?

In the case of 1) in the previous question : where the details still there after the commit ?
leclaudeAuthor Commented:
For question 1, the toolbar enabling/disabling consists a series of set_item_property commands for the toolbar buttons.  The toolbar buttons are on a different block.  For question 2, the details re-appear after a commit.
Can you see any navigation in the code of the forms level enter_query trigger or the enabling/disabling part (maybe to the block of the buttons?)  or a clear_block/clear_record ?  I'm searching for an action that makes another (or no)  record the current record in master block.
That would explain the clearance of the details.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
leclaudeAuthor Commented:
I'm afraid I'm not seeing any navigation there or anything that would clear the block or record (other than on-clear-details and clear_all_master_details).
Are you able to share that code so we can have a look at it?
leclaudeAuthor Commented:
I'm going to mark this as complete since I was able to work around the problem.  I'd rather not put everyone through the trouble of reading through my code.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Oracle Database

From novice to tech pro — start learning today.