Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Oracle Forms - Detail block clears on enter query

Posted on 2012-04-09
12
Medium Priority
?
1,947 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

 
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
 
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 1500 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

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
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.
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.

688 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