Custom Libraty:Code Samples

对于随后的所有编码的例子,假设下面是在该事件过程的顶部声明:

1procedure event (event_name varchar2is
2form_name varchar2(30) :=
3name_in(‘system.current_form’);
4block_name varchar2(30) :=
5name_in(‘system.cursor_block’);
6begin
7
8end;

1.强制字段大写:

 1begin
 2if (event_name = ‘WHEN-NEW-FORM-INSTANCE’)
 3then
 4if (form_name = ‘APXVENDR’) then
 5app_item_property2.set_property(
 6‘VENDOR.NAME’,
 7CASE_RESTRICTION, UPPERCASE);
 8end if;
 9end if;
10end;

2.更改字段提示:

 1begin
 2if (event_name = ‘WHEN-NEW-FORM-INSTANCE’)
 3then
 4if (form_name = ‘APXVENDR’) then
 5app_item_property2.set_property(
 6'vendor.name', PROMPT_TEXT,
 7'Supplier Name');
 8end if;
 9end if;
10end;

3.更改按钮标签:

 1begin
 2if (event_name = ‘WHEN-NEW-FORM-INSTANCE’)
 3then
 4if (form_name = ‘APXVENDR’) then
 5app_item_property2.set_property(
 6'vendors.details', LABEL,
 7'More Details');
 8end if;
 9end if;
10end;

4.更改字段背景颜色:

Code

5.隐藏字段:

Code

6.设置不可更新和插入:

Code

7.添加菜单:

1begin
2if (event_name = ‘WHEN-NEW-FORM-INSTANCE’) then
3if (form_name = ‘DEMXXEOR’) then
4app_special2.instantiate(‘SPECIAL15’,
5Print Order &Again’, ‘’, TRUE, ‘LINE’);
6end if;
7end if;
8end;

As with the APP_SPECIAL routines, APP_SPECIAL2 routines support up to
45 entries spread among the Tools, Reports, and Actions menus, including
check boxes on the Tools menu. See your Oracle Applications Developer’s
Guide for more information.

8.切换工具菜单项:

Code

9.为菜单添加逻辑:

1begin
2if (event_name = ‘SPECIAL15’) then
3if (form_name = ‘DEMXXEOR’ and
4block_name = ‘ORDERS’) then
5/* Add your Print Order logic here */
6raise FORM_TRIGGER_FAILURE;
7end if;
8end if;
9end;

10.要先测试函数or功能已定义:

Code

11.如何在EVENT事件中调用外部SP:

Code

实例1:

Code

实例2:

******

原文地址:https://www.cnblogs.com/benio/p/1605556.html