一.先来个比较简单的,标准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 ;

FORM调用FORM(标准调客户化&客户化调标准)并执行查询的实现研究的更多相关文章

  1. C#在类中用调用Form的方法

    class 你的类 { private Form1 frm; //构造函数 public 你的类( Form1 form) { frm = form; } //调用form方法 private voi ...

  2. winform实现自动更新并动态调用form实现

    winform实现自动更新并动态调用form实现 标签: winform作业dllbytenull服务器 2008-08-04 17:36 1102人阅读 评论(0) 收藏 举报  分类: c#200 ...

  3. C# 跨线程调用form控件技巧及byte[]与string型相互转换

    跨线程调用form控件技巧 private delegate void MethodSocket(object obj);//使用托管 ss = "OK"; this.BeginI ...

  4. iOS-Core-Animation-Advanced-Techniques/12-性能调优/性能调优.md

    性能调优 代码应该运行的尽量快,而不是更快 - 理查德 在第一和第二部分,我们了解了Core Animation提供的关于绘制和动画的一些特性.Core Animation功能和性能都非常强大,但如果 ...

  5. 原生Form 和 Form组件 Modelform

    主要的文件:manage.py,url.py,views.py,settings.py,models.py manage.py:项目管理文件,一般不做修改. url.py:路由系统,配置views.p ...

  6. SpringMVC form:form的一个错误(没有传到前台绑定类)

    SpringMVC form:form的一个错误(没有传到前台绑定类) 报错信息: Neither BindingResult nor plain target object for bean nam ...

  7. SpringMVC的form:form表单的使用

    为什么要使用SpringMVC的form:form表单,有两个原因:一是可以更加快捷的完成表单的开发,比如会替你做好数据类型装换等本来需要你自己动手的工作.其次就是能够更加方便的实现表单回显. 首先要 ...

  8. 【原】Oracle EBS 11无法打开Form及Form显示乱码的解决

    问题:Oracle EBS 11无法打开Form及Form显示乱码 解决: 1.尝试使用jre1.5或1.6安装目录下jre/bin/server目录里的jvm.dll替换JInitiator安装目录 ...

  9. form:select form:options 标签数据回显

    在jsp页面中经常会使用到 form:select form:options 遍历后台List集合生成 select 下拉选择器,但是 form:options 标签并没有提供一个可以回显数据的属性. ...

随机推荐

  1. [LeetCode] Split Concatenated Strings 分割串联字符串

    Given a list of strings, you could concatenate these strings together into a loop, where for each st ...

  2. ML笔记:Deep Learning

    非DL:要找好的特征 DL:无需找好的特征,但新问题:要设计好的网络架构

  3. tcp窗口滑动以及拥塞控制(转)

    转自:http://blog.chinaunix.net/uid-26275986-id-4109679.html TCP协议作为一个可靠的面向流的传输协议,其可靠性和流量控制由滑动窗口协议保证,而拥 ...

  4. [BZOJ]1143: [CTSC2008]祭祀river

    题目大意:给定一个n个点m条边的有向无环图,问最多选多少个点使得两两之间互不到达.(n<=100,m<=1000) 思路:题目所求即最长反链,最长反链=最小链覆盖,对每个点向自己能到的所有 ...

  5. 【USACO】股票市场

    题目描述 尽管奶牛天生谨慎,它们仍然在住房抵押信贷市场中大受打击,现在它们准备在股市上碰碰运 气.贝西有内部消息,她知道 S 只股票在今后 D 天内的价格. 假设在一开始,她筹集了 M 元钱,那么她该 ...

  6. [BZOJ]1069 最大土地面积(SCOI2007)

    计算几何经典题,贴板子. Description 在某块平面土地上有N个点,你可以选择其中的任意四个点,将这片土地围起来,当然,你希望这四个点围成的多边形面积最大. Input 第1行一个正整数N,接 ...

  7. Java利用Apache POI将数据库数据导出为excel

    将数据库中的数据导出为excel文件,供其他人查看 public class POITest { public static void main(String[] args) { POITest te ...

  8. MySQL插件实现浅析——插件的调用

    一. MySQL中的动态插件 最初想到这个问题是在学习mysql半同步复制相关问题的时候,为何在mysql运行时install半同步插件并开启后就能起到作用,他是如何让事务停下来等待的.安装插件的时候 ...

  9. xadmin库的下载安装及奇葩报错的解决方法

    今天主要讲xadmin库的下载和安装的.......各种问题....... 先注明:我使用的是python3.6,Django2.0,所以xadmin也应该是2.0版本会比较适配. 所以这里先给个xa ...

  10. 有些时候会看到url参数上出现%BF之类

    这是URLDecoder和URLEncoder的原因 因为他们是参数,避免影响网页的连接跳转,再到了服务器的时候会自动转过来 当URL地址中仅包含普通非中文字符串和application/x-www- ...