[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

ORacle Forms 10g: How to enable/disable blocks in Master/Detail?

Posted on 2011-04-19
6
Medium Priority
?
4,587 Views
Last Modified: 2012-08-14
When the block "Instrumento de Avaliacao" was in insert mode and now is saved or the current record is in update mode, i.e. the user is navigating through existing records, the blocks below shall be enabled.

If the block "Instrumento_Avaliacao" is in Insert mode, the blocks below "GRUPOS" and "CRITERIOS" shall be disabled.

Pay attention: The user can navigate through the records without save it. He/she can save the record later and the logic may fail.

Please, see the image of the blocks below:
 Problem 01
0
Comment
Question by:jocafi
  • 3
4 Comments
 
LVL 35

Assisted Solution

by:Mark Geerlings
Mark Geerlings earned 1000 total points
ID: 35442220
What you are asking for is not easy to do in Oracle Forms.  Basically, Oracle Forms has two modes of operation: "enter query mode" and "edit mode".  When any block is in "enter query" mode, the user cannot navigate out of the current block, but the other blocks are not actually disabled.  Oracle Forms simply will not allow navigation to other blocks until the query is either executed or cancelled.

It sounds like you want modify how Forms works when it is in the normal "edit mode", where it supports inserts, updates and deletes *AND* it normally allows navigation then to other blocks.

When the user is on existing records, either queried records, or just entered (and saved) records you want to allow navigation, but if the block is empty, or if the user navigates past the last record to a new, empty record, you want navigation to be disabled, correct?  If you set the block relationships correctly (Prevent Masterless Operations = Yes) Forms may give you this functionality, at least by not allowing actions in the detail blocks until a master record is entered.  Forms will not actually disable the detail blocks or prevent navigating to them, but it will prevent data entry and/or queries in them in this situation.  
0
 
LVL 2

Accepted Solution

by:
jocafi earned 0 total points
ID: 35442962
Thanks Markgeer,

  before your post, I had unsuccessfully set the property Prevent Masterless Operations = Yes in the relation. It did not force the user to save the record first.

  Well, the workaround was:

1) to set the PK (FIAV_SEQ) in the first block in the PRE-INSERT trigger using the sequence. This field had modified properties: "Insert allowed = no" and "Update allowed = No". For a new record, this field was always empty (NULL).

2) In the 2nd block (detail) I added the trigger WHEN-NEW-BLOCK-INSTANCE like this:

 if :FICHAS_AVALIACAO.FIAV_SEQ IS NULL THEN
        -- msg: First save the Avaliation Instrument
      MESSAGE('Primeiro, salve o Intrumento de avaliação.');
      GO_BLOCK('FICHAS_AVALIACAO');
end if;

That seems to work well. Problem Solved !!!
0
 
LVL 2

Author Comment

by:jocafi
ID: 35442995
question solved and closed.
0
 
LVL 2

Author Closing Comment

by:jocafi
ID: 35465240
Workaround created by me to solve the problem. No time to wait for perfect answers. It seems to be the problem is solved by now.
0

Featured Post

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

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

In real business world data are crucial and sometimes data are shared among different information systems. Hence, an agreeable file transfer protocol need to be established.
In this blog post, we’ll look at how using thread_statistics can cause high memory usage.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

831 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