FORM调用FORM(标准调客户化&客户化调标准)并执行查询的实现研究
一.先来个比较简单的,标准FORM调用客户话FORM并执行查询
1.修改CUSTOM.PLL,使用 fnd_function.execute实现打开和传递参数
参考例子如下
PROCEDURE event(event_name VARCHAR2) IS
--
-- This procedure allows you to execute your code at specific events
-- including:
--
-- ZOOM
-- WHEN-NEW-FORM-INSTANCE
-- WHEN-NEW-BLOCK-INSTANCE
-- WHEN-NEW-RECORD-INSTANCE
-- WHEN-NEW-ITEM-INSTANCE
-- WHEN-VALIDATE-RECORD
--
-- Additionally, product-specific events will be passed via this
-- interface (see the Applications Technical Reference manuals for
-- a list of events that are available).
--
-- By default this routine must perform 'null;'.
--
-- Oracle Corporation reserves the right to change the events
-- available through this interface at any time.
--
/* Sample code: form_name varchar2(30) := name_in('system.current_form');
block_name varchar2(30) := name_in('system.cursor_block');
param_to_pass1 varchar2(255);
param_to_pass2 varchar2(255);
begin
-- Zoom event opens a new session of a form and
-- passes parameter values to the new session. The parameters
-- already exist in the form being opened.
if (event_name = 'ZOOM') then
if (form_name = 'DEMXXEOR' and block_name = 'ORDERS') then
param_to_pass1 := name_in('ORDERS.order_id');
param_to_pass2 := name_in('ORDERS.customer_name');
fnd_function.execute(FUNCTION_NAME=>'DEM_DEMXXEOR',
OPEN_FLAG=>'Y',
SESSION_FLAG=>'Y',
OTHER_PARAMS=>'ORDER_ID="'||param_to_pass1||
'" CUSTOMER_NAME="'||param_to_pass2||'"');
-- all the extra single and double quotes account for
-- any spaces that might be in the passed values
end if; -- This is an example of a product-specific event. Note that as
-- of Prod 15, this event doesn't exist.
elsif (event_name = 'OE_LINES_PRICING') then
get_custom_pricing('ORDERS.item_id', 'ORDERS.price'); -- This is an example of enforcing a company-specific business
-- rule, in this case, that all vendor names must be uppercase.
elsif (event_name = 'WHEN-VALIDATE-RECORD') then
if (form_name = 'APXVENDR') then
if (block_name = 'VENDOR') then
copy(upper(name_in('VENDOR.NAME')), 'VENDOR.NAME');
end if;
end if;
else
null;
end if;
end event;
*/
--
-- Real code starts here
--
form_name VARCHAR2(30) := name_in('system.current_form');
block_name varchar2(30) := name_in('system.cursor_block');
special_menu_name13 VARCHAR2(2000);
special_menu_name14 VARCHAR2(2000);
special_menu_name15 VARCHAR2(2000);
param_to_pass1 NUMBER := NULL;
param_to_pass2 NUMBER := NULL;
param_to_pass3 varchar2(200) := NULL;
param_to_pass4 number := NULL;--invoiec_id
param_to_pass5 number := NULL;--ccid
param_to_pass6 date := NULL;--gl_date
param_to_pass7 number := NULL;--set_of_books_id
V_PROPERTY VARCHAR2(30);
V_COUNT NUMBER;
V_INVOICE_ID NUMBER;
V_TERM_ID NUMBER;
v_date date;
CURSOR rec_invoice_line(p_invoice_id IN NUMBER) IS
SELECT l.invoice_id,
l.org_id,
l.inventory_item_id,
l.item_description,
l.po_header_id,
l.po_line_id,
l.po_release_id,
l.po_line_location_id,
l.po_distribution_id
FROM ap_invoice_lines_all l
WHERE l.invoice_id = p_invoice_id
AND l.po_line_id IS NOT NULL
AND l.amount <> 0; CURSOR rec_invoice_lok(p_invoice_id IN NUMBER) IS
SELECT l.terms_id
FROM ap_invoices_all l
WHERE l.invoice_id = p_invoice_id
FOR UPDATE NOWAIT; BEGIN
special_menu_name13 := '返利';
special_menu_name14 := '订单';
special_menu_name15 := '更新';
--FND_MESSAGE.DEBUG('CUSTOM.PLL');
IF form_name = 'APXINWKB' AND event_name = 'WHEN-NEW-FORM-INSTANCE' THEN
--SET_MENU_ITEM_PROPERTY('SPECIAL.MENU15',LABEL,'自动创建');
--FND_MESSAGE.DEBUG('WHEN-NEW-FORM-INSTANCE');
set_menu_item_property('FILE.SAVE', enabled, PROPERTY_ON);-- able save menu
app_special2.instantiate('SPECIAL13', special_menu_name13, NULL, TRUE); --添加菜单API
app_special2.instantiate('SPECIAL14', special_menu_name14, NULL, TRUE); --添加菜单API
app_special2.instantiate('SPECIAL15', special_menu_name15, NULL, TRUE); --添加菜单API RETURN;
END IF; IF form_name = 'APXINWKB' AND event_name = 'WHEN-NEW-ITEM-INSTANCE' /*AND
block_name = 'INV_SUM_FOLDER'*/ THEN
IF name_in('INV_SUM_FOLDER.QUICK_PO_NUMBER') IS NULL THEN
set_item_property('INV_SUM_CONTROL.MATCH', enabled, property_false);
ELSE
set_item_property('INV_SUM_CONTROL.MATCH', enabled, property_true);
END IF;
--FND_MESSAGE.DEBUG('WHEN-NEW-ITEM-INSTANCE');
V_INVOICE_ID := NAME_IN('INV_SUM_FOLDER.INVOICE_ID');
SELECT COUNT(*)
INTO V_COUNT
FROM AP_INVOICE_LINES_ALL L
WHERE l.invoice_id = V_INVOICE_ID
AND L.PO_LINE_ID IS NOT NULL
AND L.amount <> 0;
--FND_MESSAGE.DEBUG(V_INVOICE_ID||'---'||V_COUNT);
IF V_COUNT = 0 THEN
app_special.enable('SPECIAL15', property_OFF);
ELSE
app_special.enable('SPECIAL15', property_on);
END IF;
RETURN; END IF; IF form_name = 'APXINWKB' AND event_name = 'WHEN-NEW-BLOCK-INSTANCE' THEN --SET_MENU_ITEM_PROPERTY('SPECIAL.MENU15',LABEL,'自动创建');
app_special.enable('SPECIAL13', property_on);
app_special.enable('SPECIAL14', property_on);
app_special.enable('SPECIAL15', property_on); RETURN;
END IF; IF ((form_name = 'APXINWKB') /*and (Block_Name = 'LINES')*/
AND (event_name = 'SPECIAL13')) THEN
param_to_pass1 := name_in('INV_SUM_FOLDER.ORG_ID');
param_to_pass2 := name_in('INV_SUM_FOLDER.VENDOR_ID');
param_to_pass4 := name_in('INV_SUM_FOLDER.INVOICE_ID');
param_to_pass5 := name_in('INV_SUM_FOLDER.ACCTS_PAY_CODE_COMBINATION_ID');
param_to_pass6 := name_in('INV_SUM_FOLDER.GL_DATE');
param_to_pass7 := name_in('INV_SUM_FOLDER.SET_OF_BOOKS_ID');
--FND_MESSAGE.DEBUG('CUSTOM.PLL');
--FND_MESSAGE.DEBUG('param_to_pass4 '||param_to_pass4);
--FND_MESSAGE.DEBUG('param_to_pass5 '||param_to_pass5);
--FND_MESSAGE.DEBUG('param_to_pass6 '||param_to_pass6);
--FND_MESSAGE.DEBUG('param_to_pass7 '||param_to_pass7);
V_PROPERTY := Get_Menu_Item_Property('FILE.SAVE',enabled);
--FND_MESSAGE.DEBUG('V_PROPERTY '||V_PROPERTY);
--set_menu_item_property('FILE.SAVE', enabled, PROPERTY_OFF);-- disable save menu fnd_function.execute(function_name => 'CUXAPREBATE',
open_flag => 'Y',
session_flag => 'Y',
other_params => 'G_ORG_ID="' || param_to_pass1 ||
'" G_VENDOR_ID="' ||
param_to_pass2 || /*'"'||*/
'" G_INVOICE_ID="' ||
param_to_pass4 ||
'" G_CCID="' ||
param_to_pass5 ||
'" G_GL_DATE="' ||
param_to_pass6 ||
'" G_SET_OF_BOOKS_ID="' ||
param_to_pass7 || '"'); ELSIF ((form_name = 'APXINWKB') /*and (Block_Name = 'LINES')*/
AND (event_name = 'SPECIAL14')) THEN
param_to_pass3 := name_in('INV_SUM_FOLDER.QUICK_PO_NUMBER');
fnd_function.execute(function_name => 'CUXAPPOINFOR',
open_flag => 'Y',
session_flag => 'Y',
other_params => 'G_PO_NUMBER="' || param_to_pass3 ||
'"' ); ELSIF ((form_name = 'APXINWKB') /*and (Block_Name = 'LINES')*/
AND (event_name = 'SPECIAL15')) THEN
fnd_message.debug('XXXXXXXX:'||NAME_IN('INV_SUM_FOLDER.VENDOR_ID'));
V_INVOICE_ID := NAME_IN('INV_SUM_FOLDER.INVOICE_ID');
FOR REC_INVOICE IN rec_invoice_line(p_invoice_id => V_INVOICE_ID) LOOP open rec_invoice_lok(p_invoice_id => REC_INVOICE.INVOICE_ID); SELECT H.TERM_ID
INTO V_TERM_ID
FROM CUX_OMS_PO_HEADERS H,PO_HEADERS_ALL PH
WHERE H.PO_NUMBER = PH.SEGMENT1
AND H.PROCESS_STATUS = 'COMPLETE'
AND PH.PO_HEADER_ID = REC_INVOICE.PO_HEADER_ID; SELECT rt.transaction_date
into v_date
FROM rcv_transactions rt
WHERE rt.po_header_id = REC_INVOICE.PO_HEADER_ID; UPDATE AP_INVOICES_ALL
SET TERMS_ID = V_TERM_ID,
TERMS_DATE = v_date
WHERE INVOICE_ID = REC_INVOICE.INVOICE_ID; close rec_invoice_lok;
END LOOP;
ELSE
RETURN;
END IF; END event;
2.在客户化FORM里创建参数,接收传过来的,如上面程序中的G_ORG_ID,G_VENDOR_ID等等
3.在客户化FORM里根据传过来的参数执行查询即可实现
二.客户化FORM调用标准FORM并执行查询
1.利用个性化来实现具体如下
客户化Form A 调用标准 Form B;在Form A上定义一个全局参数,B 获取这个参数,作为查询条件,B上设置个性化
Form B获取Form A过来的参数,把参数的值赋给Form B的ITEM
2.利用CUSTOM.PLL实现
例子如下
打开PO
PROCEDURE BTN_OPEN_PO IS
BEGIN fnd_function.Execute(Function_Name => 'PO_POXPOEPO',
Open_Flag => 'Y',
Session_Flag => 'Y',
Other_Params => 'PO_HEADER_ID=' || :Po.Po_Header_Id || ' '
||' ACCESS_LEVEL_CODE="MODIFY"'
||' POXPOEPO_CALLING_FORM="POXSTNOT"',
Activate_Flag => 'ACTIVATE'); END ;
打开SO
PROCEDURE BTN_OPEN_SO IS
BEGIN
fnd_function.Execute(Function_Name => 'ONT_OEXOEORD',
Open_Flag => 'Y',
Session_Flag => 'Y',
Other_Params => 'DESKTOP_HEADER_ID="' || :So.So_Header_Id || '"',
Activate_Flag => 'ACTIVATE');
END ;
BEGIN fnd_function.Execute(Function_Name => 'ONT_OEXOEORD',
Open_Flag => 'Y',
Session_Flag => 'Y',
Other_Params => 'DESKTOP_HEADER_ID="' || :So.So_Header_Id || '"',
Activate_Flag => 'ACTIVATE'); END ;
FORM调用FORM(标准调客户化&客户化调标准)并执行查询的实现研究的更多相关文章
- C#在类中用调用Form的方法
class 你的类 { private Form1 frm; //构造函数 public 你的类( Form1 form) { frm = form; } //调用form方法 private voi ...
- winform实现自动更新并动态调用form实现
winform实现自动更新并动态调用form实现 标签: winform作业dllbytenull服务器 2008-08-04 17:36 1102人阅读 评论(0) 收藏 举报 分类: c#200 ...
- C# 跨线程调用form控件技巧及byte[]与string型相互转换
跨线程调用form控件技巧 private delegate void MethodSocket(object obj);//使用托管 ss = "OK"; this.BeginI ...
- iOS-Core-Animation-Advanced-Techniques/12-性能调优/性能调优.md
性能调优 代码应该运行的尽量快,而不是更快 - 理查德 在第一和第二部分,我们了解了Core Animation提供的关于绘制和动画的一些特性.Core Animation功能和性能都非常强大,但如果 ...
- 原生Form 和 Form组件 Modelform
主要的文件:manage.py,url.py,views.py,settings.py,models.py manage.py:项目管理文件,一般不做修改. url.py:路由系统,配置views.p ...
- SpringMVC form:form的一个错误(没有传到前台绑定类)
SpringMVC form:form的一个错误(没有传到前台绑定类) 报错信息: Neither BindingResult nor plain target object for bean nam ...
- SpringMVC的form:form表单的使用
为什么要使用SpringMVC的form:form表单,有两个原因:一是可以更加快捷的完成表单的开发,比如会替你做好数据类型装换等本来需要你自己动手的工作.其次就是能够更加方便的实现表单回显. 首先要 ...
- 【原】Oracle EBS 11无法打开Form及Form显示乱码的解决
问题:Oracle EBS 11无法打开Form及Form显示乱码 解决: 1.尝试使用jre1.5或1.6安装目录下jre/bin/server目录里的jvm.dll替换JInitiator安装目录 ...
- form:select form:options 标签数据回显
在jsp页面中经常会使用到 form:select form:options 遍历后台List集合生成 select 下拉选择器,但是 form:options 标签并没有提供一个可以回显数据的属性. ...
随机推荐
- [LeetCode] Set Intersection Size At Least Two 设置交集大小至少为2
An integer interval [a, b] (for integers a < b) is a set of all consecutive integers from a to b, ...
- [LeetCode] 4 Keys Keyboard 四键的键盘
Imagine you have a special keyboard with the following keys: Key 1: (A): Print one 'A' on screen. Ke ...
- vue插件移动框
npm i dragablemodel -S(安装插件) import dragablemodel from 'dragablemodel' Vue.use(loading) 模板(组件) <d ...
- codefroces 297E Mystic Carvings
problem:一个圆上依次有1~2*n的数字.每个数字都有且只有另一个数字与他相连.选出三条线,使得每条线的两端之间隔的最少点(只包括被选择的6个点)的个数相等.输入输出格式输入格式: The fi ...
- [ZJOI2008]生日聚会
题目描述 今天是hidadz小朋友的生日,她邀请了许多朋友来参加她的生日party. hidadz带着朋友们来到花园中,打算坐成一排玩游戏.为了游戏不至于无聊,就座的方案应满足如下条件: 对于任意连续 ...
- BZOJ3129: [Sdoi2013]方程
拓展Lucas+容斥原理 #include<cstdio> #include<cstdlib> #include<algorithm> #include<cs ...
- [Codeforces]852I - Dating
题目大意:给定一棵n个点的树,每个点上有一个汉子或妹子,每人有一个权值,每次询问一条链上选出一对权值相等的男女有多少种选法.(n,q<=10^5) 做法:比较显然的树上莫队,熟悉序列莫队那套理论 ...
- bzoj 3451 Normal
Description 某天WJMZBMR学习了一个神奇的算法:树的点分治! 这个算法的核心是这样的: 消耗时间=0 Solve(树 a) 消耗时间 += a 的 大小 如果 a 中 只有 1 个点 ...
- 【LSGDOJ 1850】滑雪课程
题目描述 贝西去科罗拉多州去滑雪,不过还她不太会玩,只是个能力为 1 的渣渣.贝西从 0 时刻进入滑雪场,一到 T 时刻就必须离开.滑雪场里有 N 条斜坡,第 i 条斜坡滑行一次需要 D i 分钟,要 ...
- hdu 5727 二分图+环排列
Necklace Time Limit: 3000/1500 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Su ...