In the secondary development of Oracle EBS form, it is often necessary to flexibly control whether or not some components are available and visible; sometimes you want the values of some fields to be automatically generated or manually entered; sometimes we want to set different behavior controls based on different responsibilities and users. Common requirements:
- Only some roles can see the "register order" button in the sales order.
- Only some roles can switch to a tab.
- The Order Number is automatically generated or manually entered as needed
- The value of quick encoding can be input to all applications, or only one application can be input. You can also enter only values of a certain type of application.
- In some cases, the form only needs to be able to query
- ......
There are many methods to implement these functions in the Oracle EBS environment,Profile),Sub-function (subfunction)AndFunction parameter)Is the most commonly used and most convenient and effective method,
I. Sub-functions (subfunction)
The sub-function is actually a special function. The sub-function is actually used with the Oracle EBS function permission control to achieve security control, the essence is that a user can execute an authorized function. In general, the sub-function is used to control whether certain buttons are displayed, thereby realizing whether the user can operate certain functions in the form, therefore, Oracle EBS developers often use sub-functions to pass throughShow/hideOrValid/invalidThe components on the interface to realize the function is valid or invalid, such as the above common requirements, 1 and 2 Use sub-functions is the most suitable.
As follows, I hope that only authorized users can see the book order button. What they cannot see is naturally unable to perform this operation.
Steps:
1. Define a sub-function for the book order button component
2, FormCodeControl components based on functions
In the PRE-FORM trigger, to determine whether the user has the permission to see this operation, if there is show otherwise not show
?[Copy to clipboard] View code PLSQL
12345 |
If ( Fnd_function . Test( 'Xhuorder _ book_order' ) ) Then App_item_property . Set_property ( 'Headers. book_order' , Displayed , Property_on ) ; Else App_item_property . Set_property ( 'Headers. book_order' , Displayed , Property_off ) ; End If ; |
3. Grant sub-functions to authorized users
If a user needs to display this button, add the sub-function xhuorder_book_order to the menu corresponding to the user's responsibilities, and add the sub-function xhuorder_book_order as a menu item,Leave prompt BlankYou can
You need to leave the prompt field blank during definition so that this menu item is invisible when the menu is displayed. The actual key is the final grant column, which is checked by default, it represents the user authorized to relevant roles and responsibilities.
Ii. Function Parameters
The function parameter method is actually the same as the sub-function control method. It uses the function permission to control the function. It defines multiple functions for the same form, the values of different function parameters are different for control. The most typical application of Oracle EBS is the query function and lookup Code definition interface in form.
On the quick encoding definition interface, you can use the appl_short_name parameter to control the quick encoding that can only be queried for feature applications. The lookup_type parameter controls the quick encoding of feature types. The interface behavior varies with parameter values.
Steps:
1. Define parameters in Form Designer
Parameters such
2. In formProgramReference parameter values in the code to control
Based on business requirements and functional design requirements, you can write code by parameter values, such
?[Copy to clipboard] View code PLSQL
123456789101112131415 |
If ( : Parameter . Lookup_type Is Not Null ) Then Set_block_property ( 'Fnd _ lookup_types' , Insert_allowed , Property_false ) ; End If ; If ( : Parameter . Appl_short_name Is Not Null ) Then : Parameter . Appl_short_name : = Upper ( : Parameter. Appl_short_name ) ; : Parameter . Appl_id : = Fnd_utilities . Get_application_id ( : Parameter . Appl_short_name ) ; : Parameter . Application : = Fnd_utilities . Get_application_name ( : Parameter . Appl_id ) ; App_item_property . Set_property ( 'Fnd _ lookup_types.application_name' , Insert_allowed , Property_off ) ; End If ; |
The parameter value of parameter is passed in from the function definition during form operation.
3. Set specific parameter values when defining a function
As shown in the preceding demand_class quick encoding, the parameter is view_application = "au" lookup_type = "demand_class"
A parameter is defined for the function. During running, the system searches for parameters with the same name in the form parameter and sends the value after equal sign (=) to the parameter, multiple parameters are separated by spaces. Therefore, different functions can be defined based on different function parameter values, and different control measures can be implemented by assigning responsibilities to corresponding users.
3. Profile)
Preset file control is one of the most flexible and powerful methods in these methods. Through preset files, you can control the site layer, application layer, responsibility layer, and user layer, the preset file is equivalent to a global variable in the Oracle EBS system. This global variable can be set to different values in different contexts, therefore, you can use it in form development to control the business logic. The common requirements listed above can all be implemented using the method of Preset files, but the preset files are too flexible, therefore, some requirements appear to be of little use. Therefore, you only need to flexibly control the layer and comply with the hierarchical control of the site layer, application layer, responsibility layer, and user layer.
Steps:
1. Define preset files
Define a preset file under the role of application developer, just like defining a variable in the Oracle EBS system. The SQL validation area is a list of values that can be defined in the preset file.
2. Control Based on preset file values in Form
?[Copy to clipboard] View code PLSQL
1234567 |
Rochelle order_num_mode : = Fnd_profile . Value ( 'Demo _ order_number_mode' ) ; If : Parameter . Order_number_mode = 'Invocation' Then App_item_property . Set_property ( 'Headers. order_number' , Required , Property_false ) ; App_item_property . Set_property ( 'Headers. order_number' , Enterable , Property_false ) ; App_item_property . Set_property ( 'Headers. order_number' , Navigable , Property_false ) ; End If ; |
The above Code indicates that if the value of demo_order_number_mode In the preset file is set to automatic, order_number is controlled.
3. Set the value of the preset file.
In the form program, different control is performed based on different preset file values, while the preset file values are set as needed.
Based on the preset file values, the form control items show different behaviors according to the settings.
The three methods described above are the most commonly used method in Secondary Development of Oracle EBS form. select the most suitable method based on different functional requirements.
Reprinted: http://oracleseeker.com/2009/09/01/graphical_component_control_in_oracle_ebs_form/