Use custom. PLL to modify the lov of the standard form

Source: Internet
Author: User

During the development process, we often encounter the need to modify the lov in the standard form. In general, some conditions are imposed. Without modifying the FMB file of the standard form, you can useCustom. PLL.

 

I. Working Mechanism of PLL M. PLL

 

Most forms in EBS are in the template. FMB is created, and some HR Module forms are created in hrtemplt. created based on FMB. These templates form will call custom in form-level triggers. PLL

Form-level triggers are:

  1. Zoom
  2. When-New-form-instance
  3. When-New-block-instance
  4. When-New-record-instance
  5. When-New-item-instance
  6. When-validate-record

 

In the HRMS module, the following triggers also call custom. PLL.

  1. PRE-DELETE
  2. Post-delete
  3. PRE-UPDATE
  4. Post-Update
  5. PRE-INSERT
  6. Post-insert
  7. Post-forms-commit
  8. When-create-record
  9. KEY-DELREC

 

Among these triggers, call_all_libraries (event_name) in the app_standard.event process will be called, and the call_all_libraries process will call custom. Event (event_name ).

 

Ii. Use custom. PLL to modify the lov of the standard form

 

Download the custom. PLL file from the server and open it using form builder. Click PL/SQL libraries, and click Create to save it as a PLL file, for example, xxpoxpoepo. PLL. Create a package xxpoxpoepo

 

 

Create procedure set_po_vendor_lov:

 

Code:

 Procedure set_po_vendor_lov is <br/> l_query_string varchar2 (2000); <br/> l_customer_group_id recordgroup; <br/> l_temp_id number; <br/> l_customer_lov; <br/> begin <br/> If name_in ('System. cursor_item ') = 'po _ headers. vendor_name 'then <br/> l_query_string: = 'select distinct POV. vendor_name, POV. segment1 from <br/> po_vendors POV where POV. enabled_flag = "Y" '; <br/> if not id_null (find_group ('cux _ supplier_name') Then <br/> delete_group ('cux _ supplier_name '); <br/> end if; <br/> l_customer_group_id: = create_group_from_query ('cux _ supplier_name ', <br/> l_query_string ); <br/> set_lov_property ('suier ier _ name', group_name, 'cux _ supplier_name '); <br/> end if; <br/> end set_po_vendor_lov; <br/>

 

First, use create_group_from_query to create a lov record group,

Replace the LOV group we want to modify with the group we created. This process is called in when-New-item-instance. To prevent other items that do not use this lov, therefore, name_in ('System. cursor_item ') = 'po _ headers. vendor_name 'condition judgment,

In addition, because the record group is created once in the second time, if it is created again, an error is reported.

If not id_null (find_group ('cux _ supplier_name ') then
Delete_group ('cux _ supplier_name ');

End if;

 

Delete group and create again (delete_group can only delete the record group created by the Program ). This logic is used not to determine whether the group already exists when it is created because the QUERY_STRING is dynamic. Therefore, the result of each lov operation can be correct only when it is created every time.

Next, we need to add our PLL to custom, click attached libraries of custom, click Add, and select xxpoxpoepo. Double-click m package in custom. PLL,

 

Modify the procedure event process to the following:

 Procedure event (event_name varchar2) is <br/> form_name varchar2 (30): = name_in ('System. current_form '); <br/> block_name varchar2 (30): = name_in ('System. cursor_block '); <br/> item_name varchar2 (30): = name_in ('System. cursor_item '); <br/> begin <br/> If event_name = 'when-New-item-instance' then <br/> If form_name = 'poxpoepo 'and block_name = 'po _ headers' and <br/> item_name = 'po _ headers. vendor_name 'then <br/> xxpoxpoepo. set_po_vendor_lov; <br/> end if; <br/> end event; <br/>

 

At the beginning, I used the custom process to determine whether the current item is equal to vendor_name (red-colored code, some forms may have no data found errors (for example, the application developer's function form), because the form is opened when the system. cursor_item is empty, so the item judgment should be written into the custom PLL.

Finally, upload custom. PLL and xxpoxpoepo. PLL to the $ au_top/resource directory on the server, compile the PLL using the following command, exit EBS, and log on again. The lov takes effect.

F60gen module_type = library module = custom userid = apps/apps

Source: http://oracleseeker.com/category/oracle_ebs_top/oracle_ebs_customization/page/14/

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.