目标:输入供应商id后,点击zoom按钮,弹出此供应商历史信息。
前期准备:一个forms name:HEK_PO_SPLHIS_TEST
1.启用ZOOM按钮
1
function zoom_available return boolean is 2

3
form_name varchar2(30) := name_in('system.current_form'); 4
block_name varchar2(30) := name_in('system.cursor_block');5

6
begin7

8
if9
… -- [code from previous exercises]10

11
--begin add by guozhenbin 2009-11-1912
elsif (form_name = 'HEK_PO_SPLHIS_TEST') then13
return true;14
--end add by guozhenbin 2009-11-1915

16
else17
return FALSE;18
end if;19


2.定义Zoom触发的事件
1
procedure event(event_name varchar2) is2
--------BEGIN ADD BY GUOZHENBIN 2009-11-193
l_param_to_pass number;4
--------END ADD BY GUOZHENBIN 2009-11-195
begin6
if
7
… -- [code from previous exercises]8

9
---------- begin add by guozhenbin 2009-11-1910
elsif (event_name = 'ZOOM') then 11
if(form_name = 'HEK_PO_SPLHIS_TEST') and (block_name = 'HEK_PO_SPLHIS_TEST') then12
l_param_to_pass := name_in('HEK_PO_SPLHIS_TEST.VENDOR_ID');13
14
if l_param_to_pass is null then15
fnd_message.debug('vendor id is not null!');16
elsif fnd_function.test('HEK_PO_SPLHIS') and l_param_to_pass is not null then17
fnd_function.execute(function_name => 'HEK_PO_SPLHIS',18
open_flag => 'Y',19
session_flag => 'Y',20
other_params => ' P_VENDOR_ID = ' || l_param_to_pass);21
else22
fnd_message.debug('function exception!');23
end if;24
end if;25
-----------end add by guozhenbin 2009-11-1926
end;