Solved

Oracle Forms - Detail block clears on enter query

Posted on 2012-04-09
12
1,709 Views
Last Modified: 2012-05-11
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
0
Comment
Question by:leclaude
  • 6
  • 5
12 Comments
 
LVL 20

Expert Comment

by:flow01
ID: 37824998
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
 
LVL 16

Expert Comment

by:Wasim Akram Shaik
ID: 37825013
--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
 
LVL 20

Expert Comment

by:flow01
ID: 37825117
wasimibm : that is true for a change in the detail-record, but  leclaude changes the master block .
0
 
LVL 1

Author Comment

by:leclaude
ID: 37827526
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
 
LVL 20

Expert Comment

by:flow01
ID: 37828711
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
 
LVL 1

Author Comment

by:leclaude
ID: 37829548
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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 20

Expert Comment

by:flow01
ID: 37829786
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
 
LVL 1

Author Comment

by:leclaude
ID: 37832339
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
 
LVL 20

Accepted Solution

by:
flow01 earned 500 total points
ID: 37832631
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
 
LVL 1

Author Comment

by:leclaude
ID: 37837336
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
 
LVL 20

Expert Comment

by:flow01
ID: 37838628
Are you able to share that code so we can have a look at it?
0
 
LVL 1

Author Comment

by:leclaude
ID: 37957622
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

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and the…
I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
This video explains at a high level with the mandatory Oracle Memory processes are as well as touching on some of the more common optional ones.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now