在开发中对系统标准form的修改一般不建议修改系统原有FORM,对所需要修改的内容一般写在CUSTOM.PLL里即可,应为每个form运行的时候都会调用CUSTOM.PLL具体概念性东西可参考网上资料,很多的这里不再重述,只针应用做介绍

一,开发对象:程序 PROCEDURE event(event_name VARCHAR2);

二.判断在哪里触发

举例

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;
--IF :SYSTEM.FORM_ATATUS = 'NEW' OR :SYSTEM.FORM_ATATUS = 'CHANGED' THEN
--V_STATUS := SYSTEM.BLOCK_ATATUS;
--FND_MESSAGE.DEBUG('SYSTEM.BLACK_ATATUS');
-- END IF;
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;

三.获取FORM里面ITEM的值

V_INVOICE_ID :=  NAME_IN('INV_SUM_FOLDER.INVOICE_ID');

四.工具里面菜单开发

定义变量

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);

菜单名称

 special_menu_name13 := '返利';
special_menu_name14 := '订单';
special_menu_name15 := '更新';

初始化菜单

 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-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

五。调用客户化FORM

IF ((form_name = 'APXINWKB') /*and (Block_Name = 'LINES')*/
AND (event_name = 'SPECIAL13')) THEN
IF name_in('System.Form_Status') = 'CHANGED' THEN
old_level := NAME_IN('system.message_level');
COPY('5','system.message_level');
commit;
COPY(old_level,'system.message_level');
END IF;
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 ||
'"' ); END IF;

六。更新FORM上数据

IF ((form_name = 'APXINWKB') /*and (Block_Name = 'LINES')*/
AND (event_name = 'SPECIAL15')) THEN
BEGIN
--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); BEGIN
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;
EXCEPTION
WHEN OTHERS THEN
FND_MESSAGE.DEBUG('V_TERM_ID:'||SQLERRM);
END ; BEGIN
SELECT rt.transaction_date
into v_date
FROM rcv_transactions rt
WHERE rt.TRANSACTION_ID = REC_INVOICE.RCV_TRANSACTION_ID
AND ROWNUM = 1;
EXCEPTION
WHEN OTHERS THEN
FND_MESSAGE.DEBUG('v_date:'||SQLERRM);
END ;
SELECT V.NAME
INTO V_NAME
FROM ap_terms_vl V
WHERE V.TERM_ID = V_TERM_ID; COPY(V_NAME,'INV_SUM_FOLDER.TERMS_NAME');
COPY(V_TERM_ID,'INV_SUM_FOLDER.TERMS_ID');
COPY(v_date,'INV_SUM_FOLDER.TERMS_DATE');
/*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;
exit;
END LOOP;
old_level := NAME_IN('system.message_level');
COPY('5','system.message_level');
commit;
COPY(old_level,'system.message_level');
--query_block(p_block_name =>'INV_SUM_FOLDER');
EXCEPTION
WHEN OTHERS THEN
FND_MESSAGE.DEBUG('更新发票头时出现错误:'||sqlerrm);
END;
ELSE
RETURN;
END IF;

七.失效/生效 FORM项或者菜单

  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;
--IF :SYSTEM.FORM_ATATUS = 'NEW' OR :SYSTEM.FORM_ATATUS = 'CHANGED' THEN
--V_STATUS := SYSTEM.BLOCK_ATATUS;
--FND_MESSAGE.DEBUG('SYSTEM.BLACK_ATATUS');
-- END IF;
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;



CUSTOM.PLL的使用的更多相关文章

  1. Form_通过Custom.pll新增菜单项(案例)

    2014-05-31 Created By BaoXinjian

  2. 修改CUSTOM.PLL文件调用客户化FORM&修改标准FORM

    修改custom.pll文件里 的过程event:参考例子如下,修改好后上传至$AU_TOP/resource 运行编译frmcmp_batch CUSTOM apps/apps module_typ ...

  3. Error : APP-FND-01926: The custom event WHEN-LOGON-CHANGED raised unhandled exception: ORA-06502: PL

    In this Document   _afrLoop=440418974213449&id=1508865.1&_afrWindowMode=0&_adf.ctrl-stat ...

  4. Form_通过Zoom客制化跳转页面功能(案例)

    2012-09-08 Created By BaoXinjian

  5. FORM调用FORM(标准调客户化&客户化调标准)并执行查询的实现研究

    一.先来个比较简单的,标准FORM调用客户话FORM并执行查询 1.修改CUSTOM.PLL,使用 fnd_function.execute实现打开和传递参数 参考例子如下 PROCEDURE eve ...

  6. EBS开发常用编译命令

    一.编译FORM 1.将脚本写成shell脚本 cd $AU_TOP/forms/ZHS export FORMS_PATH=.:$FORMS_PATH:$AU_TOP/forms/ZHS frmcm ...

  7. Deploying Customizations in Oracle E-Business Suite Release 12.2

    DeployingCustomizations in Oracle E-Business Suite Release 12.2 This documentdescribes how to deploy ...

  8. PS_Form个性化复杂需求新增Menu并调用Request(案例)

    2014-06-01 Created By BaoXinjian

  9. Oracle Form个性化案例(一)

    业务场景: 现有Form A,需通过A中的菜单栏中调用另一Form B,需将某值作为参数传入Form B中:

随机推荐

  1. 再深刻理解下web3.js中estimateGas如何计算智能合约消耗的gas量

    我们可使用web3.js框架的estimateGas函数获得一个以太坊智能合约的Gas估计值 ,通过执行一个消息调用或交易,该消息调用或交易直接在节点的VM中执行,并未在区块链中确认,函数会返回估算使 ...

  2. [HNOI 2003]激光炸弹

    Description 一种新型的激光炸弹,可以摧毁一个边长为R的正方形内的所有的目标.现在地图上有n个目标,用整数,表示目标在地图上的位置,每个目标都有一个价值.激光炸弹的投放是通过卫星定位的,但其 ...

  3. codeforces 842C Ilya And The Tree

    Ilya is very fond of graphs, especially trees. During his last trip to the forest Ilya found a very ...

  4. 【USACO】干草金字塔

    题目描述 贝西要用干草包堆出一座金字塔.干草包会从传送带上陆续运来,依次出现 N 包,每包干草可 以看做是一个二维平面上的一个长方形,第 i 包干草的宽度是 W i ,长度统一为 1. 金字塔的修建有 ...

  5. 【Codeforces Round 431 (Div. 2) A B C D E五个题】

    先给出比赛地址啦,感觉这场比赛思维考察非常灵活而美妙. A. Odds and Ends ·述大意:      输入n(n<=100)表示长度为n的序列,接下来输入这个序列.询问是否可以将序列划 ...

  6. hihocoder 1249(2015ACM/ICPC北京)

    题意: 给你一块正方形的土地,里面有矩形的草地,要求把土地分成两份,满足以下两个条件 1.两边的绿洲,左边>=右边,差值尽可能的小 2.在满足1的情况下分给左边的土地尽快能的多 而且绿洲不会出现 ...

  7. Ubuntu16 编译源码安装MXNet 可变卷积Deformable-ConvNets GPU版

    [引言]最近接手了公司的关于虫子识别的项目,使用MXNet框架开发,但是实际用的是Deformable-ConvNets. Deformable-ConvNets为微软研究研究院提出的可变卷积网络,可 ...

  8. day5 liaoxuefeng---实战篇

  9. Scrapy框架

    Scrapy是一个为了爬取网站数据,提取结构性数据而编写的应用框架. 其可以应用在数据挖掘,信息处理或存储历史数据等一系列的程序中.其最初是为了页面抓取 (更确切来说, 网络抓取 )所设计的, 也可以 ...

  10. Windows Server2003本地用户的批量导入和导出(转)

    AD域环境的用户导入和导出 Windows server 2003 批量导入用户---CSVDE 在新搭建的域环境中,有许多的域帐号需要导入,可以采用csvde命令来导入域用户:新建一个txt文本文件 ...