Modifying the Default Master-Detail Functionality
In special situations, you may want to modify or extend the default master-detail functionality that Oracle Forms provides. For example, if your application runs against non-ORACLE data sources or includes long relation chains that require non-standard functionality, you might want to implement your own block coordination mechanism.
Oracle Forms provides a number of triggers and Built-in subprograms that
are useful for such tasks, some of which are Listed here.
Triggers:
- On-Clear-Details
- On-Populate-Details
- On-Check-Delete-Master
- When-New-Record-Instance
- When-New-Block-Instance
Built-in subprograms:
- GET_BLOCK_PROPERTY
- SET_BLOCK_PROPERTY
- GET_FORM_PROPERTY
- GET_RELATION_PROPERTY
- SET_RELATION_PROPERTY
For example, you can use these Built-in subprograms as follows:
- Use GET_FORM_PROPERTY to get the name of the first and last block in the
form (FIRST_BLOCK, LAST_BLOCK).
- Use GET_BLOCK_PROPERTY to find out a block's current COORDINATION_STATUS
(either COORDINATED or NON_COORDINATED) and a block's FIRST_RELATION, that
is, the name of the first relation in which the block is a master.
- Use SET_BLOCK_PROPERTY to set block properties dynamically.
- Use GET_RELATION_PROPERTY to get the current property settings for a relation
(MASTER_DELETES, DEFERRED_COORDINATION, and AUTOQUERY), the names of the master
and detail blocks (MASTER_NAME, DETAIL_NAME), and the name of the next relation
in the form (NEXT_MASTER_RELATION, NEXT_DETAIL_RELATION). For example, to
assign the name of the master block in a relation to a local variable you
might write the following:
DECLARE
master_block VARCHAR2;
BEGIN
master_block := Get_Relation_Property('my_relation',
MASTER_BLOCK);
END;
- Use SET_RELATION_PROPERTY to set the properties of a relation dynamically.
For example, to set the Delete Record Behavior property you could call the
following procedure:
SET_RELATION_PROPERTY('my_relation',
master_deletes,
Related topics
GET_RELATION_PROPERTY Built-in
SET_RELATION_PROPERTY Built-in