Oracle Form Usage Considerations

Source: Internet
Author: User

One, handling errors
1. When the error occurs in Oracle Form PL/SQL, the method is handled as follows:

begin  if  Then     fnd_message.set_name (Appl_short_name, message_name);    Fnd_message.error;    Raise Form_trigger_failure;   End if ; End;

2. When the error occurs in stored procedure, the method is handled as follows:

begin  if  Then     fnd_message.set_name (Appl_short_name, message_name);    app_exception.raise_exception;   End if ; End;

3. When we test form_success,form_failure and form_fatal, it may trigger the sub-program of the target to change their values, such as the following example:

begin   go_item (' emp.empno ');   if  Then     raise form_trigger_failure;   End if ; End;

Go_item causes other triggers to trigger, such as when-new-item-instance, although Go_item may fail, but subsequent trigger may succeed, which means from_failure is invalid, To avoid this situation, you can change to the following:

begin   go_item (' emp.empno ');   if !=  Then     raise form_trigger_failure;   End if ; End;

4. Avoid using raise_application_error because it conflicts with the settings of the process service we use
5. Do not use Call_form, you can use Fnd_function. Execute to replace Call_form or Open_form.

Ii. areas to note in the use of PL/SQL in Oracle Application
1. Use Select ... from dual to replace Select ... from sys.dual;
2. A select query that returns only one row to handle the no_data_found exception, INSERT, UPDATE, delete do not produce this exception, use Sql%notfound to check for data

Iii. Triggers in Forms
1. All trigger of block or field are either override or before, in general the before type is used because the same trigger is usually triggered in the form hierarchy. The exception to this is if the Post-query domain calls the form hierarchy, but you reset the query state of the block in Post-query of block, as in this case, the block block's post-query must set the execution type to after

IV, using Appcore instead of Oracle Forms built-in, Appcore contains features equivalent to Oracle forms built-ins
1.exit_form do not use Exit_from directly, you should always use Do_key (' exit_form ') if you need to exit the entire Oracle Applications suite, you should first call copy (' Y ', ' GLOBAL. Appcore_exit_flag '), and then call Do_key (' Exit_form ');
2.set_item_property use App_item_property. Set_property and App_item_property. Set_visual_attribute instead of
4.open_form use Fnd_function. Execute to replace
5.clear_form use Do_key (' Clear_form ') instead of
6.commit uses Do_key (' Commit_form ') instead of
7.edit_field using Do_key (' Edit_field ' Instead, this program pops the calendar
8.validate use App_standard when the current item is date. App_validate to replace

V. Coding Table handlers

Vi. setting properties of an object
The size of the 1.Canvas can only be set to a height of 5inch, Width 7.8inch, in order to better adapt to the client's environment
2. Use App_custom. Open_window and App_custom. Close_window to open and close the window, but using Go_block can also be used to open the window function
3.app_special to control whether a menu item is available

Vii. setting up some of the dependencies of item
1.Text Items
In general, most of the text items use the Text_item attribute class, and need to display multiple lines using the Text_item_multiline attribute class, if field is a DATE type using Text_item_date, Set its query length to 255 characters
2.Date fields
You can use Dbdate or dbdatetime to set the preset date as it
3. To apply the Lov to an item in Enter-query mode, create an item-level Key-listval trigger, as follows:

begin  if != -  Then     list_values;   Else     Show_lov (' Query Lov ');   End if ; End;

4.Flexfields
The key elastic domain uses the ' enable_list_lamp ' Lov, and the validation is set to No, and the descriptive elastic field is not used to Lov

Eight, control window, BLOCK
1. Control the window of the operating period
For example, in the Purchase Order window contains a button called ' Lines ', click it to go to another window Lines this block, the steps required are as follows:
The first step: Modify the following trigger
Trigger:pre-form
app_window.set_window_position (' HEADER ', ' First_window ');
trigger:when-buttion-pressed
App_custom.open_window (' LINES ');
Step Two: Modify the App_custom. Open_window
If wnd = ' LINES ' Then
app_window.set_window_position (' LINES ', ' CASCADE ', ' HEADER ');
Go_block (' lines ');
End if;
the following types are available:
CASCADE This type is displayed at the top of the parent window and 0.3 from the right side of the parent window when the child window is open, usually for the detail window
Right , BELOW slightly
overlap slightly
CENTER slightly
First_window typically used in the main window
2. Close the window
a form has three windows divided by ' Header ', ' Lines ' and ' shipments ', shipments is Lines's detail window, and Lines is the Header's detail window, logically closing the window as follows:

ProcedureClose_window (Wnd varchar20) is   IfWnd=' HEADER ' ThenApp_window.close_first_window; elsif Wnd=' Lines ' ThenApp_custom.close_window (' shipments '); If(WND=Get_view_property (Get_item_property (: System.cursor_item,item_canvas), Window_name) Thengo_block (' header '); End if; elsif Wnd=' Shipments ' Then     If(WND=Get_view_property (Get_item_property (: System.cursor_item,item_canvas), Window_name) ThenGo_block (' lines '); End if; End if; Hide_window (WND); End;

3. Using queries during execution
If you want to call a Row-lov or query window before opening the FORM, add it after when-new-form-instance:
Execute_trigger (' Query_find ');

Oracle Form Usage Considerations

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.