Thursday, August 27, 2015

Basic Java for OAF

 

OOPS Concepts

Object:-

An object is a software bundle of related state and behavior.

Software objects are often used to model the real-world objects that you find in everyday life.

Real-world objects share two characteristics: They all have state and behavior.

Dogs have state (name, color, breed, hungry) and behavior (barking, fetching, wagging tail).
Software objects are conceptually similar to real-world objects: they too consist of state and related behavior.

 An object stores its state in fields (variables in some programming languages) and exposes its behavior through methods (functions in some programming languages). Methods operate on an object's internal state and serve as the primary mechanism for object-to-object communication.


Class:-

            A class is the blueprint from which individual objects are created.
           
            Public class Dog
{
                        String breed;
                        int age;
                        String color;
                        Public void barking ()
{
              //write the required code
                         }
  
                       
Public void hungry ()
{
-----
-----
                         }
}
Abstraction:-

Hiding unnecessary data from user is called Abstraction access   specifiers like public, private etc are used to provide different level in abstraction.

Example:-

Suppose take a car: In that we will have breaks and staring and etc...   Here when we are changing the gear box to up or bottom then gears will work but we don't know how they are managing internally and we don't no how it is working. As a driver we don't need to know how it is working internally when we are changing every time. That is the reason they will hide the wires and cables internally and they will show up only gear box to us.

Advantages:- Code will be clean and for managing it will be very easy
Encapsulation:-

Taking data and object in a single unity is called Encapsulation.
A class is example for Encapsulation. In our class we need to make all our variables and methods keeping together.

Advantage:- Maintenance will be good.
 Inheritance:- 

Creating a new class from existing class is called Inheritance.
acquiring the properties from super class to subclass.

Example:-

Suppose take two java classes Class A contains 2 variables and Class B Extends Class A that means here Class B can access the class A variables without declaring it. If we do this then the memory will be less and reusable.

class B extends A
 {
    // new fields and methods defining
    // Class A methods are inherited here.
}
Reusability is main advantage in inheritance.
 Interface:-

An interface is a contract between a class and the outside world. When a class implements an interface, it promises to provide the behavior published by that interface.
Methods form the object's interface with the outside world. In its most common form, an interface is a group of related methods with empty bodies.

Example:-

The buttons on the front of your television set are the interface   between you and the electrical wiring on the other side of its plastic casing. You press the "power" button to turn the television on and off.
 Package:-

A package is a namespace for organizing classes and interfaces in a logical manner. Placing your code into packages makes large software projects easier to manage. Because software written in the Java programming language can be composed of hundreds or thousands of individual classes, it makes sense to keep things organized by placing related classes and interfaces into packages.
Polymorphism:- 

If single method performs different task is called polymorphism.
There are 2 types:
1) Compile time polymorphism
.
2) Run time polymorphism
.

Method overloading is an example for Compile time polymorphism and Method overriding is an example for Run time polymorphism.
Overloading:-

If you have two methods with same name in one Java class with different method signature than its called overloaded method in Java.
Overriding:-

Overriding is only pertinent to derived classes, where the parent class has defined a method and the derived class wishes to override that function.

LAG and LEAD functions in Oracle


Both LAG and LEAD functions have the same usage, as shown below.
 
LAG  (value_expression [,offset] [,default]) 
OVER ([query_partition_clause] order_by_clause) 
 
LEAD (value_expression [,offset] [,default]) 
OVER ([query_partition_clause] order_by_clause)
  • value_expression - Can be a column or a built-in function, except for other analytic functions.
  • offset - The number of rows preceeding/following the current row, from which the data is to be retrieved. The default value is 1.
  • default - The value returned if the offset is outside the scope of the window. The default value is NULL.
Looking at the EMP table, we query the data in salary (SAL) order.
SELECT empno,
       ename,
       job,
       sal
FROM   emp
ORDER BY sal;

     EMPNO ENAME      JOB              SAL
---------- ---------- --------- ----------
      7369 SMITH      CLERK            800
      7900 JAMES      CLERK            950
      7876 ADAMS      CLERK           1100
      7521 WARD       SALESMAN        1250
      7654 MARTIN     SALESMAN        1250
      7934 MILLER     CLERK           1300
      7844 TURNER     SALESMAN        1500
      7499 ALLEN      SALESMAN        1600
      7782 CLARK      MANAGER         2450
      7698 BLAKE      MANAGER         2850
      7566 JONES      MANAGER         2975
      7788 SCOTT      ANALYST         3000
      7902 FORD       ANALYST         3000
      7839 KING       PRESIDENT       5000

LAG

The LAG function is used to access data from a previous row. The following query returns the salary from the previous row to calculate the difference between the salary of the current row and that of the previous row. Notice that the ORDER BY of the LAG function is used to order the data by salary.
SELECT empno,
       ename,
       job,
       sal,
       LAG(sal, 1, 0) OVER (ORDER BY sal) AS sal_prev,
       sal - LAG(sal, 1, 0) OVER (ORDER BY sal) AS sal_diff
FROM   emp;

     EMPNO ENAME      JOB              SAL   SAL_PREV   SAL_DIFF
---------- ---------- --------- ---------- ---------- ----------
      7369 SMITH      CLERK            800          0        800
      7900 JAMES      CLERK            950        800        150
      7876 ADAMS      CLERK           1100        950        150
      7521 WARD       SALESMAN        1250       1100        150
      7654 MARTIN     SALESMAN        1250       1250          0
      7934 MILLER     CLERK           1300       1250         50
      7844 TURNER     SALESMAN        1500       1300        200
      7499 ALLEN      SALESMAN        1600       1500        100
      7782 CLARK      MANAGER         2450       1600        850
      7698 BLAKE      MANAGER         2850       2450        400
      7566 JONES      MANAGER         2975       2850        125
      7788 SCOTT      ANALYST         3000       2975         25
      7902 FORD       ANALYST         3000       3000          0
      7839 KING       PRESIDENT       5000       3000       2000

LEAD

The LEAD function is used to return data from the next row. The following query returns the salary from the next row to calulate the difference between the salary of the current row and the following row.
SELECT empno,
       ename,
       job,
       sal,
       LEAD(sal, 1, 0) OVER (ORDER BY sal) AS sal_next,
       LEAD(sal, 1, 0) OVER (ORDER BY sal) - sal AS sal_diff
FROM   emp;

     EMPNO ENAME      JOB              SAL   SAL_NEXT   SAL_DIFF
---------- ---------- --------- ---------- ---------- ----------
      7369 SMITH      CLERK            800        950        150
      7900 JAMES      CLERK            950       1100        150
      7876 ADAMS      CLERK           1100       1250        150
      7521 WARD       SALESMAN        1250       1250          0
      7654 MARTIN     SALESMAN        1250       1300         50
      7934 MILLER     CLERK           1300       1500        200
      7844 TURNER     SALESMAN        1500       1600        100
      7499 ALLEN      SALESMAN        1600       2450        850
      7782 CLARK      MANAGER         2450       2850        400
      7698 BLAKE      MANAGER         2850       2975        125
      7566 JONES      MANAGER         2975       3000         25
      7788 SCOTT      ANALYST         3000       3000          0
      7902 FORD       ANALYST         3000       5000       2000
      7839 KING       PRESIDENT       5000          0      -5000
 
 

Rank, Dense, First and Last functions with examples

 

RANK

Let's assume we want to assign a sequential order, or rank, to people within a department based on salary, we might use the RANK function like.
SELECT empno,
       deptno,
       sal,
       RANK() OVER (PARTITION BY deptno ORDER BY sal) "rank"
FROM   emp;

     EMPNO     DEPTNO        SAL       rank
---------- ---------- ---------- ----------
      7934         10       1300          1
      7782         10       2450          2
      7839         10       5000          3
      7369         20        800          1
      7876         20       1100          2
      7566         20       2975          3
      7788         20       3000          4
      7902         20       3000          4
      7900         30        950          1
      7654         30       1250          2
      7521         30       1250          2
      7844         30       1500          4
      7499         30       1600          5
      7698         30       2850          6 
 
What we see here is where two people have the same salary they are 
assigned the same rank. When multiple rows share the same rank the
next rank in the sequence is not consecutive.

DENSE_RANK

The DENSE_RANK function acts like the RANK function except that it assigns consecutive ranks.
SELECT empno,
       deptno,
       sal,
       DENSE_RANK() OVER (PARTITION BY deptno ORDER BY sal) "rank"
FROM   emp;

     EMPNO     DEPTNO        SAL       rank
---------- ---------- ---------- ----------
      7934         10       1300          1
      7782         10       2450          2
      7839         10       5000          3
      7369         20        800          1
      7876         20       1100          2
      7566         20       2975          3
      7788         20       3000          4
      7902         20       3000          4
      7900         30        950          1
      7654         30       1250          2
      7521         30       1250          2
      7844         30       1500          3
      7499         30       1600          4
      7698         30       2850          5

FIRST and LAST

The FIRST and LAST functions can be used to return the first or last value from an ordered sequence. Say we want to display the salary of each employee, along with the lowest and highest within their department we may use something like.
SELECT empno,
       deptno,
       sal,
       MIN(sal) KEEP (DENSE_RANK FIRST ORDER BY sal) OVER (PARTITION BY deptno) "Lowest",
       MAX(sal) KEEP (DENSE_RANK LAST ORDER BY sal) OVER (PARTITION BY deptno) "Highest"
FROM   emp
ORDER BY deptno, sal;

     EMPNO     DEPTNO        SAL     Lowest    Highest
---------- ---------- ---------- ---------- ----------
      7934         10       1300       1300       5000
      7782         10       2450       1300       5000
      7839         10       5000       1300       5000
      7369         20        800        800       3000
      7876         20       1100        800       3000
      7566         20       2975        800       3000
      7788         20       3000        800       3000
      7902         20       3000        800       3000
      7900         30        950        950       2850
      7654         30       1250        950       2850
      7521         30       1250        950       2850
      7844         30       1500        950       2850
      7499         30       1600        950       2850
      7698         30       2850        950       2850
 
 

Steps to create a XML Publisher Report


1] Add the “Xml Publisher Administrator” Responsibility to the user through the front end.

2] Create the Report(Data Model or we can say the .Rdf file) using Oracle Report Builder.

3] Set the user parameter as p_conc_request_id.

4] Add the default values to the Before Report and After Report triggers(not mandatory)

5] Ftp the Report to the Cust_Top/Report/Us.

6] Open the Oracle E-Business Suite then go to Sysadmin>Concurrent>Program>Executables, Here we have to create one executable file for that Rdf.

7] Then go to Sysadmin>Concurrent>Program>Define, Here we have to make a Concurrent Program for that Executable. Make sure that the output format must be XML.

8] Goto the Sysadmin>Security>Responsibility>Define. Query for the Xml Publisher Administrator. See the Request Group attached to this. Attach the Concurrent Program to this Request Group.

9] Design the template in Ms Word(Using the .Rtf file).

10] Goto responsibility XML PUBLISHER ADMINISTRATOR. Then Goto HOME>DATA DEFINITION>CREATE DATA DEFINITION and create a new data definition. Make sure that your Data Definition’s Code should be same as Concurrent Program’s Short Name used by you to create the Rdf file.

11] Now go to Xml publisher administrator>Home>Template. Create a new template with template type=’Rtf’. Then upload the RTF File by browsing the path.

12] Now go to the Responsibility and run the request.



Registering Reports in Oracle Application

 

Steps Required for Registering a Simple Report

1. Create a Report using Report Builder.
2. Compile and copy .RDF file in module specific directory.
3. Register the executable with System Administrator Module.
4. Define the Concurrent Program.
5. Assign the executable to Concurrent Program.
6. Assign the Concurrent Program to Request Group.
7. Assign the Request Group to the Responsibility.
8. Assign the Responsibility to the User.

 

Registering Parametric Reports

1. Create a Report using Report Builder with parameters.
2. Compile and copy .RDF file in module specific directory.
3. Register the executable with System Administrator Module.
4. Define the Value set to validate the parameters.
5. Define the Concurrent Program.
6. Assign the executable to Concurrent Program.
7. Define Parameters.
8. Assign Value Set to the Parameters.
9. Assign bind parameter of yours to the TOKEN.
Note: Token is used to map bind parameters with the formal parameters of the Concurrent Program.
10. Assign the Concurrent Program to Request Group.
11. Assign the Request Group to the Responsibility.
12. Assign the Responsibility to the User.
To reference the values of Prior Parameters of a particular program into the values of other parameter is based on the Value Set. The value of the 1st parameter is to be referenced in where clause of the 2nd Parameter.
WHERE Deptno = :$FLEX$.First_Parameter

Summary column vs. Formula Column vs. Placeholder Column


We use these columns in our oracle reports, but always have few doubts about which column to use for what purposes. Here are few brief differences among these columns and the purpose of their use in oracle reports.

Summary column:

It summarizes another column and can recalculate for each record in a specified group. The following properties apply specifically to summary columns:
  • Function: The calculation to be performed on the values of the column specified in Source.
  • Source: The name of the column whose values are to be summarized.
  • Reset At: The group at which the summary column value resets to zero.
  • Compute At: The group for which a % of Total summary column is computed.
The datatype of a summary column depends on the data type of the source of the summary. If you change the data type of the source column, the datatype of the summary also changes. The Report Wizard does not support page summaries. If you select a page summary in the Field tab of the Report Wizard, an error message appears.

Formula Column:

A formula column performs a user-defined computation on the data of one or more other columns. A formula column executes a PL/SQL function and must return a value. The value can be Character, Number, or Date and returned value must match data type.

Placeholder Column:

A placeholder column is an empty container at design time. The placeholder can hold a value at run time that has been calculated and placed into it by PL/SQL code from another object.Using placeholder columns, you can:
  • Populate multiple columns from one piece of code. You can calculate several values in one block of PL/SQL code in a formula column and assign each value to a different placeholder column. Thus, you create and maintain only one program unit instead of many.
  • Store a temporary value for future reference. For example, store the current maximum salary as records are retrieved.

A Scenario:

The goal is to design a salary report of all employees. The aim of the report is to:
  • Calculate and temporarily store the name of the employee who earns the highest salary in the company.
  • Display the highest earner and the maximum salary once at the beginning of the report.
For this report, you need to create the following columns:
  • A summary to show the maximum salary for the company.
  • A placeholder to contain the highest earner’s name at run time.
  • A formula to:
    • Compare each employee salary with the maximum salary.
    • Populate the placeholder with the employee name if salary equals maximum salary.
     

Commands for Form Compilation


Login to Application Server on Unix Box for Compiling Forms

Command in 11i :
f60gen module=CUSTOM.pll userid=apps/(appspwd) module_type=LIBRARY batch=NO compile_all=special output_file=$AU_TOP/resource/CUSTOM.plx
f60gen module=XXPOCF.fmb userid=apps/(appspwd) module_type=form batch=no compile_all=special output_file=$XXPO_TOP/forms/US/XXPOCF.fmx

Command in R12 :
$ORACLE_HOME/bin/frmcmp_batch module_type=LIBRARY module=$AU_TOP/resource/CUSTOM.pll userid=apps/(appspwd) output_file=$AU_TOP/resource/CUSTOM.plx compile_all=special
$ORACLE_HOME/bin/frmcmp_batch module=$XXFND_TOP/forms/US/XXFND_FHLOG.fmb userid=apps/(appspwd) output_file=$XXFND_TOP/forms/US/XXFND_FHLOG.fmx module_type=form compile_all=special

Form Personalization

With the Oracle E-Business Suite release 11.5.10, the Oracle has introduced a mechanism which revolutionizes the way the forms can be customized to fulfill the customer needs. For many years, Oracle Applications has provided a custom library using which the look and behavior of the standard forms can be altered, but the custom library modifications require extensive work on SQL and PL/SQL. In the release 11.5.10, Oracle has provided a simple and easy feature to implement the customer specific requirements without modifying the underlying forms code or CUSTOM library. Although CUSTOM library still can be used for forms customization to implement the complex business logic, the personalization feature provided in the latest release is easy, faster and requires minimum development effort.

Why Forms Personalization?

  • Oracle Supports personalization unlike customization.
  • Personalizations are stored in tables rather than files.
  • Will not have a bigger impact when you upgrade or apply patches to the environment.
  • Can be moved easily through FNDLOAD from one instance to other.
  • Can be restricted at site/responsibility/user level.
  • Easy to disable/enable with click of a button.
  • Personalization stores who columns with which we have the ability to track who created/modified it where as in CUSTOM.PLL we don’t have that ability.
  • Can be applied to new responsibilities/users easily.
  • Can be restricted to a function or form.

What can be implemented through Forms Personalization?

The below can be done using Personalization: 
  • Zoom from one form to another.
  • Pass data from one form to another through global variables.
  • Change LOV values dynamically.
  • Enable/Disable/Hide fields dynamically
  • Display user friendly messages when required
  • Launch URL directly from oracle form
  • Execute PL/SQL programs through FORM_DDL package
  • Call custom libraries dynamically

Personalization Tables:

FND_FORM_CUSTOM_RULES
FND_FORM_CUSTOM_ACTIONS
FND_FORM_CUSTOM_SCOPES
FND_FORM_CUSTOM_PARAMS
FND_FORM_CUSTOM_PROP_LIST
FND_FORM_CUSTOM_PROP_VALUES

Invoking the Personalization screen:

The personalization form should be used to implement the custom rules on a specific form. The specific form refers to the desired form on which you want to apply the custom business logic or modify the form behavior.
The personalization form is invoked by…
Menu Navigation: Help > Diagnostics > Custom Code > Personalize

Disable the personalization feature:

It is possible that a change you make completely breaks a form, to the point that it will not even run! Here’s how to recover:
  • On the pulldown menu, choose Help > Diagnostics > Custom Code > Off
    • This will disable all callouts to Forms Personalization
  • Run the form of interest
    • It should run now, because your changes were skipped
  • Invoke the Personalization screen and correct the problem
  • On the pulldown menu, choose Help > Diagnostics > Custom Code > Normal to re-enable processing of Personalizations

Limitations:

Although it is faster than a speeding bullet, it is not able to leap over tall buildings:
  • You can only change what Forms allows at runtime:
    • Cannot create new items
    • Cannot move items between canvases
    • Cannot display an item which is not on a canvas
    • Cannot set certain properties
    • Cannot change frames, graphics, boilerplate
  • You can only respond to certain Trigger Events:
    • WHEN-NEW-FORM-INSTANCE, WHEN-NEW-BLOCK-INSTANCE, WHEN-NEW-RECORD-INSTANCE, WHEN-NEW-ITEM-INSTANCE
    • WHEN-VALIDATE-RECORD (not in all forms)
    • Product-specific events
  • May interfere with, or be overridden by, base product code
  • Expected user is an Admin/Developer
    • Knowledge of Oracle Developer is extremely desirable
    • Knowledge of PL/SQL, Coding Standards and/or APIs required in some cases
  • Normal rules for customizations apply
    • Extensive testing in a Test environment is required!

Relationship with CUSTOM library:

  • CUSTOM is a stub library Oracle ships that receives Trigger Events. Customers are free to add any code they like to it.
  • CUSTOM and Form Personalizations drive off the same Trigger Events.
    • Form Personalizations are processed first, then the event is sent to CUSTOM
  • CUSTOM can do more because it has complete access to all PL/SQL and SQL.
  • But for most changes, Form Personalizations is adequate and is significantly simpler.

Triggers in Oracle Forms

Triggers are blocks of PL/SQL code that are written to perform tasks when a specific event occurs within an application. In effect, an Oracle Forms trigger is an event-handler written in PL/SQL to augment (or occasionally replace) the default processing behavior. Every trigger has a name, and contains one or more PL/SQL statements. A trigger encapsulates PL/SQL code so that it can be associated with an event and executed and maintained as a distinct object.

Block Processing Triggers:

Block processing triggers fire in response to events related to record management in a block.
  • When-Create-Record Perform an action whenever Oracle Forms attempts to create a new record in a block.
  • When-Clear-Block Perform an action whenever Oracle Forms flushes the current block; that is, removes all records from the block.
  • When-Database-Record Perform an action whenever Oracle Forms changes a record’s status to Insert or Update, thus indicating that the record should be processed by the next COMMIT_FORM operation.

Interface Event Triggers:

Interface event triggers fire in response to events that occur in the form interface. Some of these triggers, such as When-Button-Pressed, fire only in response to operator input or manipulation. Others, like When-Window-Activated, can fire in response to both operator input and programmatic control.
  • When-Button-Pressed Initiate an action when an operator selects a button, either with the mouse or through keyboard selection.
  • When-Checkbox-Changed Initiate an action when the operator toggles the state of a check box, either with the mouse or through keyboard selection.
  • When-Image-Activated Initiate an action whenever the operator double-clicks an image item.
  • When-Image-Pressed Initiate an action whenever an operator clicks on an image item.
  • When-Radio-Changed Initiate an action when an operator changes the current radio button selected in a radio group item.
  • When-Window-Activated Initiate an action whenever an operator or the application activates a window.
  • When-Window-Closed Initiate an action whenever an operator closes a window with the window manager’s Close command.
  • When-Window-Deactivated Initiate an action whenever a window is deactivated as a result of another window becoming the active window.

Master/Detail Triggers:

Oracle Forms generates master/detail triggers automatically when a master/detail relation is defined between blocks. The default master/detail triggers enforce coordination between records in a detail block and the master record in a master block. Unless developing custom block-coordination schemes, you do not need to define these triggers.
  • On-Check-Delete-Master Fires when Oracle Forms attempts to delete a record in a block that is a master block in a master/detail relation.
  • On-Clear-Details Fires when Oracle Forms needs to clear records in a block that is a detail block in a master/detail relation because those records no longer correspond to the current record in the master block.
  • On-Populate-Details Fires when Oracle Forms needs to fetch records into a block that is the detail block in a master/detail relation so that detail records are synchronized with the current record in the master block.

Message-Handling Triggers:

Oracle Forms automatically issues appropriate error and informational messages in response to runtime events. Message handling triggers fire in response to these default messaging events.
  • On-Error Replace a default error message with a custom error message, or to trap and recover from an error.
  • On-Message To trap and respond to a message; for example, to replace a default message issued by Oracle Forms with a custom message.

Validation Triggers:

Validation triggers fire when Oracle Forms validates data in an item or record. Oracle Forms performs validation checks during navigation that occurs in response to operator input, programmatic control, or default processing, such as a Commit operation.
  • When-Validate-Item
  • When-Validate-Record

Navigational Triggers:

Navigational triggers fire in response to navigational events. Navigational triggers can be further sub-divided into two categories: Pre- and Post- triggers, and When-New-Instance triggers. Pre- and Post- Triggers fire as Oracle Forms navigates internally through different levels of the object hierarchy. When-New-Instance-Triggers fire at the end of a navigational sequence that places the input focus on a different item.
  • Pre-Form Perform an action just before Oracle Forms navigates to the form from “outside” the form, such as at form startup.
  • Pre-Block Perform an action before Oracle Forms navigates to the block level from the form level.
  • Pre-Record Perform an action before Oracle Forms navigates to the record level from the block level.
  • Pre-Text-Item Perform an action before Oracle Forms navigates to a text item from the record level.
  • Post-Text-Item Manipulate an item when Oracle Forms leaves a text item and navigates to the record level.
  • Post-Record Manipulate a record when Oracle Forms leaves a record and navigates to the block level.
  • Post-Block Manipulate the current record when Oracle Forms leaves a block and navigates to the form level.
  • Post-Form Perform an action before Oracle Forms navigates to “outside” the form, such as when exiting the form.
  • When-New-Form-Instance Perform an action at form start-up. (Occurs after the Pre-Form trigger fires).
  • When-New-Block-Instance Perform an action immediately after the input focus moves to an item in a block other than the block that previously had input focus.
  • When-New-Record-Instance Perform an action immediately after the input focus moves to an item in a different record.
  • When-New-Item-Instance Perform an action immediately after the input focus moves to a different item. 

Transactional Triggers:

Transactional triggers fire in response to a wide variety of events that occur as a form interacts with the data source.
  • On-Delete
  • On-Insert
  • On-Update
  • On-Logon
  • On-Logout
  • Post-Database-Commit
  • Post-Delete
  • Post-Insert
  • Post-Update
  • Pre-Commit
  • Pre-Delete
  • Pre-Insert
  • Pre-Update

Query-Time Triggers:

Query-time triggers fire just before and just after the operator or the application executes a query in a block.
  • Pre-Query Validate the current query criteria or provide additional query criteria programmatically, just before sending the SELECT statement to the database.
  • Post-Query Perform an action after fetching a record, such as looking up values in other tables based on a value in the current record. Fires once for each record fetched into the block.

Windows in Oracle Forms


A window in oracle forms is a container for all visual objects that make up a Forms application. You can create two different type of windows in oracle forms. Lets have a brief comparisons between these two types of windows.
Modal Window:
A modal window is a restricted window that the user must respond to before moving the input focus to another window. Modal windows:
  • Must be dismissed before control can be returned to a modeless window
  • Become active as soon as they display
  • Require a means of exit or dismissal
Modeless Window:
A modeless window is an unrestricted window that the user can exit freely. Modeless windows:
  • Can display many at once
  • Are not necessarily active when displayed
  • Are the default window type
  •  

Various Canvas in Oracle Form


What is a Canvas?
A canvas is a surface inside a window container on which you place visual objects such as interface items and graphics. It is similar to the canvas upon which a picture is painted. To see a canvas and its contents at run time, you must display it in a window. A canvas always displays in the window to which it is assigned.
Canvas Types
Oracle Forms provides four types of canvases, all of which can be displayed in the same window at runtime. A canvas’ type defines how Oracle Forms will display it in the window to which it is assigned. When you create a canvas, you specify its type by setting the Canvas Type property.
The four canvas types are:
  • Content
  • Stacked
  • Tab
  • Toolbar
Content Canvas:
The most common canvas type is the content canvas (the default type). A content canvas is the “base” view that occupies the entire content pane of the window in which it is displayed. You must define at least one content canvas for each window you create.
When building an application, one of the first steps is to create content canvases that will be displayed in the windows of your form(s). While you can assign more than one content canvas to the same window at design time, at runtime only one content canvas is displayed at one time in the window.
Stacked Canvas:
A stacked canvas is displayed at top—or stacked on—the content canvas assigned to the current window. Stacked canvases obscure some part of the underlying content canvas, and often are shown and hidden programmatically. You can display more than one stacked canvas in a window at the same time.
Stacked canvases are displayed in a window along with the window’s content canvas(es) and any number of other stacked canvases. You can set the bevel, color, and pattern attributes of a stacked canvas to make it look different than the underlying content canvas.
Creating a stacked canvas is similar to creating a content canvas. To define a stacked canvas, you need to set certain canvas properties that apply only to stacked canvases, and create items and boilerplate text and graphics as you would for a content canvas. To convert an existing content canvas to a stacked canvas, simply change its Canvas Type property from Content to Stacked.
Tab Canvas:
A tab canvas—made up of one or more tab pages—allows you to group and display a large amount of related information on a single dynamic Oracle Forms canvas object. Like stacked canvases, tab canvases are displayed on top of a content canvas, partly obscuring it. Tab pages (that collectively comprise the tab canvas) each display a subset of the information displayed on the entire tab canvas.
A tab canvas can have many tab pages, and must have at least one. Think of tab pages as the folders in a filing system. Each individual tab page (folder) has a labelled tab that developers and end users click to access the page. At design time or runtime, you click the labelled tab to display the page at the front of the tab canvas, thereby obscuring any other page(s).
Tab pages are sub-objects of a tab canvas. Like the canvas to which it is attached, each tab page has properties; similarly, any item you place on a tab canvas has a canvas property as well as tab page properties. The ordering of tab pages in the Object Navigator determines the left-to-right (or top-to-bottom) order of the tabs at runtime.
Toolbar Canvas:
A toolbar canvas often is used to create toolbars for individual windows. You can create two types of toolbar canvases: horizontal or vertical. Horizontal toolbar canvases are displayed at the top of a window, just under its menu bar, while vertical toolbars are displayed along the far left edge of a window.
You can create toolbar canvases, both horizontal and vertical, for any window in a form. Oracle Forms displays horizontal toolbar canvases across the top of a window, and vertical toolbar canvases on the left edge of a window.
When you create a toolbar canvas, you assign it to a window by setting the canvas Window property, and then register it with the window by setting the window’s Vertical Toolbar Canvas or Horizontal Toolbar Canvas properties as appropriate. You can change the appearance of a toolbar at runtime by dynamically showing and hiding different items on the toolbar. You also can create more than one toolbar for the same window, and display them in response to navigation events and programmatic control, much like stacked canvases assigned to the same window.


Form Interview Questions and Answers-3


What is the difference between Pre-Form and When-New-Form-Instance trigger?
Pre-Form trigger will be fired before entering into the form. It is the first trigger that fires when a form is run; fires before the form is visible. It is useful for setting access to form items, initializing global variables, and assigning unique primary key from an Oracle sequence.
When-New-Form-Instance trigger will be fired whenever form is ready to accept the data from the user.
Another main difference between the two is that you cannot navigate in a pre-from trigger (restricted) whereas you can navigate in a when-new-form-instance trigger. For example : go_block and execute-query will only work in when-new-form-instance trigger not in pre-from trigger.
What are the triggers fired while creating Master Detail form?
On-Clear Details (Form Level)
On-Populate-Details (Block Level)
On-Check-delete-Master (Block Level)
How will you get the block Name in a form?
By using SYSTEM.CURRENT_BLOCK
What is the difference between Pre-insert and On-insert trigger?
Pre-insert trigger fires during the Post and Commit Transactions process, before a row is inserted. It fires once for each record that is marked for insert. On-insert trigger fires during the Post and Commit Transactions process when a record is inserted. Specifically, it fires after the Pre-Insert trigger fires and before the Post-Insert trigger fires, when Form Builder would normally insert a record in the database. It fires once for each row that is marked for insertion into the database.
What is the difference between Pre-Query and Post-Query trigger?
Pre-Query trigger validates the current query criteria or provide additional query criteria programmatically, just before sending the SELECT statement to the database. Post-Query trigger perform an action after fetching a record, such as looking up values in other tables based on a value in the current record. It fires once for each record fetched into the block.
What is the trigger sequence while opening a form?
Pre-Form,
Pre-Block,
Pre-Record,
Pre-Item,
When-new-form-Instance,
When-new-block-Instance,
When-new-Record-instance,
When-new-Item-instance,
Post-item,
post-record,
Post-block,
Post-form
What is the difference between new form, open form & call form?
New_form:-Once we move into the destination automatically source will be closed.
Open_form:- It is a two way connection between source and destination. Opens the indicated form. Use OPEN_FORM to create multiple-form applications, that is, applications that open more than one form at the same time.
Call_form:- Call_form() runs an indicated form while keeping the parent form active. Without closing the destination one cannot come back to the source.
How to call a Report from a form?
By using RUN_PRODUCT Built-in.
Can we write Commit statement in forms triggers?
Yes
What is the usage of an ON-INSERT,ON-DELETE and ON-UPDATE TRIGGERS ?
These triggers are executes when inserting, deleting and updating operations are performed and can be used to change the default function of insert, delete or update respectively.
A query fetched 10 records. How many times does a PRE-QUERY Trigger and POST-QUERY Trigger will get executed ?
PRE-QUERY fires once. POST-QUERY fires 10 times.
How can you execute the user defined triggers in forms?
To execute a user-named trigger, you must call the EXECUTE_TRIGGER built-in procedure, as shown here: Execute_Trigger(‘my_user_named_trigger’);
What are Restricted Built-in Subprograms in forms?
Any built-in subprogram that initiates navigation is restricted. This includes subprograms that move the input focus from one item to another, and those that involve database transactions. Restricted built-ins are not allowed in triggers that fire in response to navigation.
For example, the GO_ITEM and NEXT_SET built-ins are both restricted procedures. GO_ITEM moves the input focus from a source item to a target item, which requires navigation. Similarly, the NEXT_SET procedure causes Oracle Forms to navigate internally to the block level, fetch a set of records, and then navigate to the first item in the first record. (Note that this navigation happens internally as a result of default processing, and may not be apparent to the form operator.) Because GO_ITEM and NEXT_SET both initiate navigation, they cannot be called from triggers that fire in response to internal navigational events; that is, triggers that fire while navigation is already occurring. Thus, a restricted procedure cannot be called from a Pre-Block trigger, because the Pre-Block trigger fires during internal navigation. In fact, restricted subprograms are not allowed from any PRE- or POST- navigational triggers. You can, however, call a restricted built-in subprogram from a When-New-Instance trigger. For example, the When-New-Item-Instance trigger fires after navigation to an item has succeeded, when the form is waiting for input.
What are System Variables in forms?
A system variable is a Oracle Forms variable that keeps track of an internal Oracle Forms state. You can reference the value of a system variable to control the way an application behaves.
List system variables available in forms 10g?
SYSTEM.CURRENT_FORM
SYSTEM.CURRENT_ITEM
SYSTEM.CURRENT_VALUE
SYSTEM.CURSOR_BLOCK
SYSTEM.CURSOR_ITEM
SYSTEM.CURSOR_RECORD
SYSTEM.CURSOR_VALUE
SYSTEM.FORM_STATUS
SYSTEM.LAST_FORM
SYSTEM.LAST_QUERY
SYSTEM.LAST_RECORD
SYSTEM.MASTER_BLOCK
SYSTEM.MESSAGE_LEVEL
SYSTEM.SUPPRESS_WORKING…..etc.
What are the triggers associated with the image item?
When-Image-activated(fires when the operator double clicks on an image Items)
When-image-pressed(fires when the operator selects or deselects the image item)
What are the built-in routines available in forms to create and manipulate a parameter list?
Add_parameter
Create_Parameter_list
Delete_parameter
Destroy_parameter_list
Get_parameter_attr
Get_parameter_list
set_parameter_attr
What are the built-ins used to trapping errors in forms?
Error_type : Returns the error message type(character)
Error_code : Returns the error number
Error_text  : Returns the message text of the Oracle Forms error
Dbms_error_code : Returns the error number of the last database error that was detected.
Dbms_error_text : Returns the message number (such as ORA-01438) and message text of the database error
What is the predefined exception available in forms ?
The FORM_TRIGGER_FAILURE exception is a predefined PL/SQL exception available only in Oracle Forms.
What are the Built-ins used for sending Parameters to forms?
You can pass parameter values to a form when an application executes the call_form, New_form, Open_form or Run_product.
How do you reference a Parameter?
In pl/sql, You can reference and set the values of form parameters using bind variables syntax.
How do you reference a parameter indirectly?
To indirectly reference a parameter use the NAME_IN or COPY built-ins.
What is forms_DDL?
It issues dynamic sql statements at run time, including server side pl/sql and DDL
What is Text_io Package?
It allows you to read and write information to a file in the file system.
What is When-Database-Record trigger?
It fires when oracle forms first marks a record as an insert or an update. The trigger fires as soon as oracle forms determines through validation that the record should be processed by the next post or commit as an insert or update. It generally occurs only when the operator modifies the first item in the record, and after the operator attempts to navigate out of the item.
What is the difference between $$DATE$$ & $$DBDATE$$?
$$DBDATE$$ retrieves the current database date
$$DATE$$ retrieves the current operating system date.
What is a timer?
Timer is a “internal time clock” that you can programmatically create to perform an action each time the timer expires.
What are built-ins associated with timers?
find_timer
create_timer
delete_timer
What is the difference between post database commit and post-form commit?
Post-form commit fires once during the post and commit transactions process, after the database commit occurs. The post-form-commit trigger fires after inserts, updates and deletes have been posted to the database but before the transactions have been finalized in the issuing the command. The post-database-commit trigger fires after oracle forms issues the commit to finalized transactions.
What is the form development process?
a) open template form 
b) Save as <your form>.fmb
c) Change the form module name as form name.
d) Delete the default blocks, window, and canvas
e) Create a window.
f) Assign the window property class to window
g) Create a canvas   
h) Assign canvas property class to the canvas
i) Assign the window to the canvas and canvas to the window
j) Create a data block       
k) Modify the form level properties. (sub class item à Text item)
l)  Modify the app_cusom package. In the program unit.
m) Modify the pre-form trigger (form level)
n) Modify the module level properties
o) Save and compile the form.
p) Place the .fmx in the server directory.
q) Register in the AOL
APPLICATION à FORMà FUNCTIONà MENU
What is template?
The TEMPLATE form is the required starting point for all development of new Forms. The TEMPLATE form includes platform–independent attachments of several Libraries.
APPSCORE :- It contains package and procedures that are required of all forms to support  the MENUS ,TOOLBARS.
APPSDAYPK :- It contains packages that control the oracle applications CALENDER FEATURES.
FNDSQF  :- It contains packages and procedures for MESSAGE DICTONARY, FLEX FIELDS, PROFILES AND CONCURRENT PROCESSING.
CUSTOM :- It allows extension of oracle applications forms with out modification of oracle application code, you can use the custom library for customization such as zoom    ( such as moving to another form and querying up specific records)
Where exactly you place your forms in APPS environment?
/apps/visappl/au/11.5.0/forms/US
What are the Different PLL’s used in Forms?
CUSTOM.pll
FNDSQF.pll
APPCORE.pll
APPCORE2.pll
appdaypk.pll
APPSTAND.pll
What are the triggers that can be modified during Forms Customization?
Pre-Forms
When-New-Form-Instance
Query_Find
Post-Form
Key-Clrfrm
Accept
What are the triggers that cannot be modified during Forms Customization?
STANDARD_ATTACHMENT
ZOOM
FOLDER_ACTION
KEY-HELP
KEY-EXIT
KEY-COMMIT
WHEN-WINDOW_CLOSED
CLOSE_WINDOW