Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Oracle Forms - Detail block clears on enter query

Posted on 2012-04-09
12
Medium Priority
?
2,018 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 21

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 21

Expert Comment

by:flow01
ID: 37825117
wasimibm : that is true for a change in the detail-record, but  leclaude changes the master block .
0
Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

 
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 21

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 21

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 21

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 21

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

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Question has a verified solution.

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

Working with Network Access Control Lists in Oracle 11g (part 1) Part 2: http://www.e-e.com/A_9074.html So, you upgraded to a shiny new 11g database and all of a sudden every program that used UTL_MAIL, UTL_SMTP, UTL_TCP, UTL_HTTP or any oth…
When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.
Suggested Courses

782 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