Você está na página 1de 38

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 prefrom 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 POSTQUERY 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 PreBlock 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 WhenNew-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 platformindependent 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 PLLs 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

FAQs in Oracle Forms Part:2


19 Nov What is a display item? Display items are similar to text items but store only fetched or assigned values. Operators cannot navigate to a display item or edit the value it contains. How many maximum number of radio buttons can you assign to a radio group? Unlimited no of radio buttons can be assigned to a radio group. Can you change the default value of the radio button group at run time? No. What triggers are associated with the radio group? Only when-radio-changed trigger associated with radio group. What are the various states of a form? CHANGED: Indicates that the form contains at least one block with a Changed record.

NEW: Indicates that the form contains only New records. QUERY: Indicates that a query is open. What are the different objects that you cannot copy or reference in object groups? objects of different modules another object groups individual block dependent items program units What are the different modals of a window? Modeless windows Modal windows What are Modeless windows? More than one Modeless window can be displayed at the same time, and operators can navigate among them if your application allows them to do so . On most GUI platforms, Modeless windows can also be layered to appear either in front of or behind other windows. What are modal windows? Modal windows are usually used as dialogs, and have restricted functionality compared to modelless windows. On some platforms for example operators cannot resize, scroll or iconify a modal window. How do you display console on a window ? The console includes the status line and message line, and is displayed at the bottom of the window to which it is assigned. To specify that the console should be displayed, set the console window form property to the name of any window in the form. To include the console, set console window to Null. Can you have more than one content canvas attached with a window? Yes. Each window you create must have at least one content canvas assigned to it. You can also create a window that has manipulate content canvas. At run time only one of the content canvas assign to a window is displayed at a time. How many windows in a form can have console?

Only one window in a form can display the console, and you cannot change the console assignment at runtime. What are the different window events activated at runtimes? When_window_activated When_window_closed When_window_deactivated When_window_resized When a form call a pl/sql routine if there is an error in the pl/sql routine how do you place custom message in the form? FND_MESSAGE.SHOW displays an informational message in a forms modal window or in a concurrent program log file only. fnd_message.set_string(Message Text); fnd_message.show; FND_MESSAGE.HINT to display a message in the forms status line and FND_MESSAGE.ERASE to clear the forms status line. FND_MESSAGE.HINT takes its message from the stack, displays the message, and then clears that message from the message stack. List the built-in routines for controlling a window during run-time? Find_window, get_window_property, hide_window, move_window, resize_window, set_window_property, show_View What built-in is used for changing the properties of a window dynamically? Set_window_property What built-in is used for showing an alert during run-time?

Show_alert Can you change alert messages at run-time? Yes. By Set_alert_property. What is the built-in function used for finding the alert? Find_alert What built-in routines are used to display editor dynamically? Edit_text item show_editor What is the difference between COPY and NAME_IN? Copy is package procedure that writes values into a field. Name_in is a package function that returns the contents of the variable to which you apply. Can you attach an lov to a field at run-time? Yes. By Set_item_proprety What is the built-in used to get and set lov properties during run-time? Get_lov_property Set_lov_property Give built-in routines related to a record groups? Create_group (Function) Create_group_from_query(Function) Delete_group(Procedure) Add_group_column(Function) Add_group_row(Procedure) Delete_group_row(Procedure) Populate_group(Function)

Populate_group_with_query(Function) Set_group_Char_cell(procedure) What is the built-in routine used to count the no of rows in a group? Get_group_row_count What are the built-ins that are used to attach an LOV programmatically to an item? set_item_property get_item_property How many number of columns a record group can have? A record group can have an unlimited number of columns of type CHAR, LONG, NUMBER, or DATE provided that the total number of column does not exceed 64K. What is the Maximum allowed length of Record group Column? Record group column names cannot exceed 30 characters. What are the built-ins used for Creating and deleting groups? CREATE-GROUP (function) CREATE_GROUP_FROM_QUERY(function) DELETE_GROUP(procedure What are the difference between Lov & List Item? Lov is a property where as list item is an item. A list item can have only one column while a lov can have one or more columns. What are the different display styles of list items? Pop List Text List Combo box What is Pop List?

The pop list style list item appears initially as a single field (similar to a text item field). When the operator selects the list icon, a list of available choices appears. What is a Text List? The text list style list item appears as a rectangular box which displays the fixed number of values. When the text list contains values that can not be displayed, a vertical scroll bar appears, allowing the operator to view and select undisplayed values. What is a Combo Box? A combo box style list item combines the features found in list and text item. Unlike the pop list or the text list style list items, the combo box style list item will both display fixed values and accept one operator entered value.

FAQs in Oracle Forms Part:1


FAQs in Oracle Forms Part:1

What are different types of modules available in oracle form? Form module a collection of objects and code routines. Menu module a collection of menus and menu item commands that together make up an application menu. Library module a collection of user named procedures, functions and packages that can be called from other modules in the application. What are the default extensions of the files created by forms modules? .fmb form module binary .fmx form module executable What are the default extensions of the files created by menu module? .mmb, .mmx What is data block & control block? Data Block:-It is a Logical Collection of Items. Control Block:-It is a data block which is totally independent of Database Table or View.

Note: A data block can have control block items but not vice versa. What is property class & visual attributes? Property Class: A property class is a named object that contains a list of properties and their settings. Once you create a property class you can base other objects on it. An object based on a property class can inherit the setting of any property in the class that makes sense for that object. Property class inheritance is an instance of subclassing. Conceptually, you can consider a property class as a universal subclassing parent. Visual Attributes: Visual attributes are the font, color, and pattern properties that you set for form and menu objects that appear in your applications interface. Visual attributes can include the following properties: Font properties: Font Name, Font Size, Font Style, Font Width, Font Weight Color and pattern properties: Foreground Color, Background Color, Fill Pattern. Every interface object has a Visual Attribute Group property that determines how the objects individual visual attribute settings (Font Size, Foreground Color, etc.) are derived. The Visual Attribute Group property can be set to Default, NULL, or the name of a named visual attribute defined in the same module. What is the difference between property class and visual attribute? We can change Visual Attribute properties dynamically at runtime, but we cannot change Property class properties. When you inherit the both Visual Attribute properties and Property class properties to an item Visual Attribute properties overrides the Property class properties. What is object group? An object group is a container for a group of objects. You define an object group when you want to package related objects so you can copy or subclass them in another module. Object groups provide a way to bundle objects into higher-level building blocks that can be used in other parts of an application and in subsequent development projects. What is Record Group? It is an internal memory data structure and a separate object in the form module. Its main usage is to provide data to the LOV and dynamically to the list item and to perform client level validations. What are the types of Record-Groups? Static Record Group:- A static record group is not associated with a query; instead, you define its structure and row values at design time, and they remain fixed at runtime. Static record groups can be created and modified only at design time.

Query Based Record Group: A query record group is a record group that has an associated SELECT statement. The columns in a query record group derive their default names, data types, and lengths from the database columns referenced in the SELECT statement. The records in a query record group are the rows retrieved by the query associated with that record group. Non Query Record Group:- A non-query record group is a group that does not have an associated query, but whose structure and values can be modified programmatically at runtime. Non-query record groups can be created and modified only at runtime. How to change Record Group dynamically? By Using Non-Query Record Group. What is Library? A library is a collection of subprograms, including user-named procedures, functions, and packages. We can attach a library to any other form, menu or library module. It provides an easy method of reusing objects and enforcing standards across the entire development organization. What are the types of canvases available in forms & what is the default canvas? Content:-it is the base view of window which occupies the entire surface of window. It can have any no of canvases but at a time only one is visible. Stacked:-It is always displayed above the content canvas because the content Canvas is the base view. It can have any no of stacked canvases and more than one stacked canvas can be displayed at a time. Tool bar:- A toolbar canvas often is used to create toolbars for individual windows. There are two types of tool bars Horizontal and Vertical Tool bar Canvas. Horizontal tool bar canvases are displayed at the top of window and only one horizontal tool bar can be attached to a form module. Vertical tool bar is used to display top to bottom on the left side of the window. Tab:-It is a collection of one or more tab pages. It is mainly used to display a large amount of related information a single dynamic form builder canvas object. Content Canvas is the default canvas. What are Alerts? An alert is a modal window that displays a message notifying the operator of some application condition. There are three styles of alerts: Stop, Caution, and Note. To display an alert, your application must execute the SHOW_ALERT built-in subprogram from a trigger or user-named subprogram. SHOW_ALERT is a function that returns a numeric constant.

Show_Alert (alert_name) Return NUMBER; What are LOVs? An LOV is a scrollable popup window that provides the end user with either a single or multicolumn selection list. LOV values are derived from record groups. The LOVs in the Form Builder interface have the same auto-reduction and searching functionality as the LOVs you create for your own applications. There are two built-in subprograms that can be used to display an LOV: 1) LIST_VALUES 2) SHOW_LOV List the system variables related in Block and Field? 1. System.block_status 2. System.current_block 3. System.current_field 4. System.current_value 5. System.cursor_block 6. System.cursor_field 7. System.field_status What is a master detail relationship? A master detail relationship is an association between two base table blocks- a master block and a detail block. The relationship between the blocks reflects a primary key to foreign key relationship between the tables on which the blocks are based. What are the Various Master and Detail Relationships? The various Master and Detail Relationship are: a) NonIsolated :: The Master cannot be deleted when a child is existing. b) Isolated :: The Master can be deleted when the child is existing. c) Cascading :: The child gets deleted when the Master is deleted. What are the procedures that will be created when a master details form created?

CHECK_PACKAGE_FAILURE CHECK_ALL_MASTER_DETAILS QUERY_MASTER_DETAILS What is mouse navigate property of button? When Mouse Navigate is True (the default), Oracle Forms performs standard navigation to move the focus to the item when the operator activates the item with the mouse. When Mouse Navigate is set to False, Oracle Forms does not perform navigation (and the resulting validation) to move to the item when an operator activates the item with the mouse. What is difference between PL/SQL library and object library in Forms? PL/SQL library contains only pl/sql codes which can be used for standardizing the validations etc. in forms whereas Object Library is used to create, store, maintain, and distribute standard and reusable Form objects. What are the different default triggers created when Master Deletes Property is set to Nonisolated? On-Check-Delete-Master On-Clear-Details On-Populate-Details What are the different default triggers created when Master Deletes Property is set to Cascade? On-Clear-Details On-Populate-Details Pre-delete What are the different default triggers created when Master Deletes Property is set to isolated? On-Clear-Details On-Populate-Details What is the difference between SHOW_EDITOR and EDIT_TEXTITEM?

Show_editor is the generic built-in which accepts any editor name and takes some input string and returns modified output string. Whereas the edit_textitem built-in needs the input focus to be in the text item before the built-in is executed. What is the LOV of Validation Property of an item? What is the use of it? When LOV for Validation is set to True, Oracle Forms compares the current value of the text item to the values in the first column displayed in the LOV whenever the validation event occurs. If the value in the text item matches one of the values in the first column of the LOV, validation succeeds, the LOV is not displayed, and processing continues normally. If the value in the text item does not match one of the values in the first column of the LOV, Oracle Forms displays the LOV and uses the text item value as the search criteria to automatically reduce the list.

Calling a Report from a Form


Calling a Report from a Form
Using RUN_PRODUCT Built-in we can call a Report from a Form. It will take 7 Parameters as follows 1) Product name :: REPORT/GRAPHICS 2) Module name :: Report name 3) Communication Mode :: Synchronous /Asynchronous SYN :: we cannot work with the Form until and unless you closes the Report. ASYN:: We can work with Form & Reprot (Navigate) 4) Exec :: Batch/Run time Batch :: it will fetch all records at a time Run time :: It will fetch only one Record at a time 5) File name :: database/Filesystem 6) Parameters :: Report Parameters 7) Display :: For Graphics (Mostly null) Ex :: If we have :p_deptno parameter then we can call as Follows RUN_PRODUCT (REPORT,'C:\TEST1.rep,SYN,BATCH,DATABASE,p_deptno, );

Commands for Form Compilation


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

Oracle Forms Personalization


Oracle Forms 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?


y y y y

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.

y y y y y

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 dont 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:
y y y y y y y y

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! Heres how to recover:
y y y y

On the pulldown menu, choose Help > Diagnostics > Custom Code > Off o This will disable all callouts to Forms Personalization Run the form of interest o 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 reenable processing of Personalizations

Limitations:
Although it is faster than a speeding bullet, it is not able to leap over tall buildings:
y

y y

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

Relationship with CUSTOM library:


y y y y

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. o 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 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.
y y y

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 records 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.
y y y y y y y y

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 managers 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 blockcoordination schemes, you do not need to define these triggers.
y y

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.
y y

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.
y y

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. Preand 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.
y y y

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.

y y y y y

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 PreForm 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.

y y y y

Transactional Triggers:
Transactional triggers fire in response to a wide variety of events that occur as a form interacts with the data source.
y y y y y y y y y y y y y

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.
y

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.

Modal & Modeless Windows in Oracle Forms


Modal & Modeless 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:
y y y

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:
y y y

Can display many at once Are not necessarily active when displayed Are the default window type

Various Canvas Types in Oracle Form Various Canvas Types 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:


y y y y

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 topor stacked onthe 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 windows 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 canvasmade up of one or more tab pagesallows 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 windows 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.

OPEN_FORM vs. CALL_FORM vs. NEW_FORM OPEN_FORM vs. CALL_FORM vs. NEW_FORM
A multiple-form application is designed to open more than one form module during a single Forms Runtime session. Every Forms Runtime session begins the same waywith a single form module being loaded into memory. Once the first form module begins execution, it can programmatically invoke any number of additional form modules, which, in turn, can invoke still other forms. When a form module programmatically invokes another, Oracle Forms looks for the new module in the appropriate directory and then loads it into memory. Lets see the following three Built-ins to invoke one form from another.

OPEN_FORM Built-in
This built-in 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. Enter Query Mode: no

Syntax:
PROCEDURE OPEN_FORM (formmodule_name VARCHAR2, activate_mode NUMBER, session_mode NUMBER, data_mode NUMBER, paramlist_id PARAMLIST);

Where: formmodule_name:
y

The name of the form to open. Datatype is VARCHAR2. Required

activate_mode:
y y

ACTIVATE: (The default.) Sets focus to the form to make it the active form in the application. NO_ACTIVATE: Opens the form but does not set focus to the form. The current form remains current.

session_mode:
y y

NO_SESSION (The default.): Specifies that the opened form should share the same database session as the current form. SESSION: Specifies that a new, separate database session should be created for the opened form.

data_mode
y y

NO_SHARE_LIBRARY_DATA (The default.):At runtime, Oracle Forms will not share data between forms that have identical libraries attached (at design time). SHARE_LIBRARY_DATA: At runtime, Oracle Forms will share data between forms that have identical libraries attached (at design time).

paramlist_id: The unique ID that Oracle Forms assigns to the parameter list at the time it is created.

CALL_FORM Built-in:

Runs an indicated form while keeping the parent form active. Oracle Forms runs the called form with the same Runform preferences as the parent form. When the called form is exited Oracle Forms processing resumes in the calling form at the point from which you initiated the call to CALL_FORM. Enter Query Mode: yes Syntax:
PROCEDURE CALL_FORM (formmodule_name VARCHAR2, display NUMBER, switch_menu NUMBER, query_mode NUMBER, data_mode NUMBER, paramlist_name VARCHAR2);

Where: formmodule_name:
y

The name of the called form (must be enclosed in single quotes). Datatype is VARCHAR2.

display:
y y

HIDE (The default.): Oracle Forms will hide the calling form before drawing the called form. NO_HIDE: Oracle Forms will display the called form without hiding the calling form.

switch_menu
y y

NO_REPLACE (The default.): Oracle Forms will keep the default menu module of the calling form active for the called form. DO_REPLACE: Oracle Forms will replace the default menu module of the calling form with the default menu module of the called form.

query_mode
y

NO_QUERY_ONLY (The default.): Oracle Forms will run the indicated form in normal mode, allowing the end user to perform inserts, updates, and deletes from within the called form.

QUERY_ONLY: Oracle Forms will run the indicated form in query-only mode, allowing the end user to query, but not to insert, update, or delete records.

data_mode
y y

NO_SHARE_LIBRARY_DATA (The default.): At runtime, Oracle Forms will not share data between forms that have identical libraries attached (at design time). SHARE_LIBRARY_DATA: At runtime, Oracle Forms will share data between forms that have identical libraries attached (at design time).

paramlist_name
y

The name you gave the parameter list object when you defined it. Datatype is VARCHAR2.

NEW_FORM Built-in
Exits the current form and enters the indicated form. The calling form is terminated as the parent form. If the calling form had been called by a higher form, Oracle Forms keeps the higher call active and treats it as a call to the new form. Oracle Forms releases memory (such as database cursors) that the terminated form was using. Oracle Forms runs the new form with the same Runform options as the parent form. If the parent form was a called form, Oracle Forms runs the new form with the same options as the parent form. Enter Query Mode: no Syntax:
PROCEDURE NEW_FORM (formmodule_name VARCHAR2, rollback_mode NUMBER, query_mode NUMBER, data_mode NUMBER, paramlist_name VARCHAR2);

Where: formmodule_name
y

Then name of the called form (must be enclosed in single quotes). Datatype is VARCHAR2.

rollback_mode

y y y

TO_SAVEPOINT (The default.): Oracle Forms will roll back all uncommitted changes (including posted changes) to the current forms savepoint. NO_ROLLBACK: Oracle Forms will exit the current form without rolling back to a savepoint. FULL_ROLLBACK: Oracle Forms rolls back all uncommitted changes (including posted changes) that were made during the current Runform session.

query_mode
y y

NO_QUERY_ONLY (The default.) Runs the indicated form normally, allowing the end user to perform inserts, updates, and deletes in the form. QUERY_ONLY Runs the indicated form in query-only mode; end users can query records, but cannot perform inserts, updates or deletes.

data_mode
y y

NO_SHARE_LIBRARY_DATA (The default.): At runtime, Oracle Forms will not share data between forms that have identical libraries attached (at design time). SHARE_LIBRARY_DATA: At runtime, Oracle Forms will share data between forms that have identical libraries attached (at design time).

paramlist_name
y

The name you gave the parameter list object when you defined it. Datatype is VARCHAR2.

Custom.pll in Oracle Application


Custom.pll in Oracle Application
Custom Library (custom.pll) allows to extend/customize Oracle Applications form(Oracle Form) without changing or modifying Oracle Applications code. Examples may include enforcing a new business rule, opening a form using zoom etc. Most of the things that we can do using custom.pll, we can achieve that using Forms Personalization. Since Custom.pll takes the full advantage of PL/SQL so it is having an edge over Forms Personalization for complex customizations. CUSTOM.pll is used to add extensions to Oracles form Functionality. Some of the common scenarios where CUSTOM.pll can be used are:1. Enabling/Disabling the fields 2. Changing the List of Values in a LOV field at runtime 3. Defaulting values 4. Additional record level validations 5. Navigation to other screens 6. Enabling Special Menu

Where is this located? Custom.pll is located in $AU_TOP/resource Directory. How to add code to this? Open this pll using the Form builder and make changes to the program units. How to compile this PLL? Once you make changes you need to compile the pll. Use the F60gen to compile it f60gen module=custom.pll userid=APPS/ output_file=$AU_TOP/resource/custom.plx module_type=library batch=no compile_all=special While writing code inside custom.pll we should consider following things: 1. We should not run any SQL statement inside this, we can use record group. 2. We should not perform any DML operations, instead we should call database procedure and functions for the same. For following Events call will go to CUSTOM Library:

WHENFORMNAVIGATE WHENNEWFORMINSTANCE WHENNEWBLOCKINSTANCE WHENNEWRECORDINSTANCE WHENNEWITEMINSTANCE WHENVALIDATERECORD SPECIALn (where n is a number between 1 and 45) ZOOM EXPORT KEYFn (where n is a number between 1-8) Custom Library contains Custom Package which is having two Functions and one procedure. 1] ZOOM_AVAILABLE: This function allows you to specify if zooms exist for the current context. If zooms are available for this block, then return TRUE else return FALSE. This routine is called on a per-block basis within every Applications form from the WHEN-NEW-BLOCK-INSTANCE trigger. Therefore, any code that will enable Zoom must test the current form and block from which the call is being made. By default this routine must return FALSE.
view source print? Sample code1:

function zoom_available return Boolean is form_name varchar2(30) := name_in('system.current_form'); block_name varchar2(30) := name_in('system.cursor_block'); begin if (form_name = 'DEMXXEOR' and block_name = 'ORDERS') then return TRUE; else return FALSE; end if; end zoom_available; Sample code2: function zoom_available return Boolean is form_name varchar2(30) := name_in('system.current_form'); block_name varchar2(30) := name_in('system.cursor_block'); begin if (form_name = 'APXINWKB' and block_name = 'INV_SUM_FOLDER') then return TRUE; elsif (form_name = 'APXINWKB' and block_name = 'LINE_SUM_FOLDER') then return TRUE; else return FALSE; end if; end zoom_available;

2] STYLE: This function returns a integer value. This function allows to override the execution style of Product specific events, but it doesnt effect generic events like when-new-form-instance. Possible return values are: 1. custom.before 2. custom.after 3. custom.override 4. custom.standard By default it returns custom.standard.

view source print? 1 Sample code: 2 function custom.style(event_name varchar2) return integer is 3 begin 4 if event_name = MY_CUSTOM_EVENT then 5 6 7 8 return custom.override; else return custom.standard; end if;

9 end style;

3] EVENT: This procedure allows you to execute your code at specific events including: ZOOM WHEN-NEW-FORM-INSTANCE WHEN-NEW-BLOCK-INSTANCE WHEN-NEW-RECORD-INSTANCE WHEN-NEW-ITEM-INSTANCE WHEN-VALIDATE-RECORD By default this routine must perform null;
view sourceprint? 01 Sample code: 02 procedure event(event_name varchar2) is 04 form_name varchar2(30) := name_in(system.current_form); 05 block_name varchar2(30) := name_in(system.cursor_block); 07 begin 09 10 11 12 13 if (form_name = 'XXBI' and block_name = 'xxcc') Then if(event_name = 'WHEN-NEW-FORM-INSTNACE') --Write your code here elsif(event_name = 'WHEN-VALIDATE-RECORD')THEN --Write your code here

14 15 16

else null end if;

17 end if; 18 end;

How to make the changes get affected? Once you make all the necessary changes, compile the pll and generate the PLX file. Since the CUSTOM library is loaded once for a given session, a user must log out of the application and sign-on again before any changes will become apparent. Forms Personalization: an alternative of custom.pll In older versions, prior to 11i, Custom.PLL was most prominently used for adding additional features in the seeded form but the latest version of Oracle EBS comes with the feature called as Forms Personalization which allows even an end user to alter the seeded forms functionality using an user interface called the Personalization form. Advantages of Forms Personalization over Custom.PLL:
y y y y y

y y y y

Forms personalization can be used by an user with limited PL/SQL knowledge. Changes take place immediately on reopening the form. Anything which can be done using Custom.PLL can be done using Forms Personalization also. Personalizations are stored in base tables related to Form Personalization. CUSTOM.pll is a single file/entity, hence only one developer can make changes to CUSTOM.pll at any given point in time. This is not a restriction in Forms personalization. Easy to disable/enable with click of a button. Can be moved easily through FNDLOAD from one instance to other. Can be restricted at site/responsibility/user level. Personalization stores who columns with which we have the ability to track who created/modified it where as in CUSTOM.PLL we dont have that ability.

Complete forms deployment process in Oracle Apps


Form Name: Customers.fmb Deployed Application: Custom AR Application Responsibility: US Receivables Super User Step 1: COPYING FILES FROM THE SERVER a) Copy TEMPLATE.fmb file from $AU_TOP/forms/US folder to a local directory. Also download APPSTAND.fmb file and place it in D:\DevSuiteHome_1\forms

b) Copy All PL/SQL Libraries from $AU_TOP/resource/US folder (one time only). Download all the .pll and .plx files to D:\DevSuiteHome_1\forms Step 2: DESIGN THE FROM IN ORACLE FORMS BUILDER a) Remove the Defaults >Open Oracle Forms Builder >Open the form TEMPLATE.fmb >Rename the form (ex XXARCUST_1) >Delete the followings from object nevigator. >Go to Data Blocks and delete BLOCKNAME, DETAILBLOCK >Go to Windows and delete BLOCKNAME >Go to Canvases and delete BLOCKNAME b) Create a new Window (ex WINDOW10) c) Create a new Canvas (ex CANVAS10) and attached it to the new Window via Property Palate d) Create a new Datablock (ex CUSTOMERS) wth items from a table. e) Create a frame in the Canvas and attached the items f) Modify the PRE-FORM Trigger >Go to triggersPREFORM >Original Code:

FND_STANDARD.FORM_INFO($Revision: 120.0 $, Template Form, FND, $Date: 2005/05/06 23:25 $, $Author: appldev $); app_standard.event(PRE-FORM); app_window.set_window_position(BLOCKNAME, FIRST_WINDOW); >Modified Code: FND_STANDARD.FORM_INFO($Revision: 1.0 $, XXARCUST_1,CUST_FORM, $Date: 2010/01/06 16:25 $, $Author: Dibyajyoti $); app_standard.event(PRE-FORM); app_window.set_window_position(WINDOW10 , FIRST_WINDOW); > Compile the code g) Modification for Program unit > Go to APP_CUSTOM*(Package Body) >Type your First window name in place of <your first window> > Compile the code h) If any Item in the Datablock is of Date type and you want to attach a standard calender to it (ex Orderdate item of Customers datablock), do the following > Go to Orderdate > Property palate > Subclass Information > Property Class > Give property class name as TEXT_ITEM_DATE > Attach LOV as ENABLE_LIST_LAMP

> Create KEY-LISTVAL item level trigger & add following code into it calendar.show; and compile the trigger. Step 3: DEPLOY THE FORM IN THE SERVER > Upload your .fmb file Step 4: CREATE THE .fmx FILE IN THE SERVER >Type the code $ORACLE_HOME/bin/frmcmp_batch module=$XXAR_TOP/forms/US/CUSTOMERS.fmb userid=<username>/<password> output_file=$XXAR_TOP/forms/US/ CUSTOMERS.fmx module_type=form compile_all=special Step 5: REGISTARING THE FORM IN ORACLE APPS a) Registaring the FORM in Oracle Apps > Go to Application Developer > Application > Form > Give the details: FORM: CUSTOMERS(name of the custom form) APPLICATION: Custom AR Application User Form Name: CUSTOMERS_DETAIL Description: Customer Detail form > save b) Registaring the FORM to a form function > System Administrator ->Application -> Function > Give the details: Form->form:CUSTOMERS_DETAIL Function:XX_CUSTOMER_DETAIL APPLICATION: Custom AR Application Properties > Type: Form User Function Name: CUSTOMERS_DETAIL_FUNCTION > save c) Finding the menu to which the above form function is to be attached. Again the menu is attached to a responsibilty. So we have go in the reverse order to find the menu name. > System Administrator ->Security -> Responsibility ->Define > Press F11 > Responsibility Name: %US%Rec (searching for US Receivables Super User) > Press Ctrl + F11

> This things will come in the form Responsibility Name: US Receivables Super User Application:Receivables (will come automatically ) >Take the Menu name >AR_NAVIGATE_GUI d) Attaching the function to a Submenu of the above Main menu > System Administrator ->Application > Menu > Press F11 > Menu: AR_NAVIGATE_GUI > Press Ctrl+F11 > Promt: Custom Interfaces > Submenu: XXAR_CUSTOM

>System Administrator ->Application > Menu > Press F11 > Menu: XXAR_CUSTOM > Press Ctrl+F11 > Create a new > Promt: Customer Detail Form (It will display in the nevigator) >Function: CUSTOMERS_DETAIL_FUNCTION (Attach the function to the submenu) > save >One request has been submitted to recompile your menus in the database e) Viewing the request submitted in the background to recompile the menus to attach the function > Go to View>Requests>Find >The status should be :Compiled Normal Step 6: VIEWING THE FORM IN ORACLE APPLICATION: >Go to Oracle apps front end. >Login with username and password >Go to US Receivables Super User>Custom Interfaces >Customer Detail Form

Você também pode gostar