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 11.1.2.0.0. How to fix this problem?

Thanks
LVL 1
leclaudeAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
flow01Connect With a Mentor Commented:
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.
0
 
flow01Commented:
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.
0
 
Wasim Akram ShaikCommented:
--I'm using Forms 11.1.2.0.0. 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

https://forums.oracle.com/forums/thread.jspa?threadID=1042885(similar question with some further questions/postings have been asked in this thread)
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
flow01Commented:
wasimibm : that is true for a change in the detail-record, but  leclaude changes the master block .
0
 
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
            Go_Block(curdtl);
            Check_Package_Failure;
            Clear_Block(NO_VALIDATE);
            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
    Clear_Block(NO_VALIDATE);
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.
0
 
flow01Commented:
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)
0
 
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.
0
 
flow01Commented:
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 ?
0
 
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.
0
 
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).
0
 
flow01Commented:
Are you able to share that code so we can have a look at it?
0
 
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.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.