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

Posted on 2011-04-19
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
Question by:jocafi
    LVL 34

    Assisted Solution

    by:Mark Geerlings
    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.  
    LVL 2

    Accepted Solution

    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:

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

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

    Author Comment

    question solved and closed.
    LVL 2

    Author Closing Comment

    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.

    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    Join & Write a Comment

    CCModeler offers a way to enter basic information like entities, attributes and relationships and export them as yEd or erviz diagram. It also can import existing Access or SQL Server tables with relationships.
    Many companies are looking to get out of the datacenter business and to services like Microsoft Azure to provide Infrastructure as a Service (IaaS) solutions for legacy client server workloads, rather than continuing to make capital investments in h…
    This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
    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.

    755 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