关键性弹性域---代码
form级trigger:
pre-form:调用如下过程
/*关键性弹性域--pre-form触发器调用过程*/
procedure pre_form is
l_coa_id number;
l_sob_id number;
l_currency_code varchar2(15);
l_org_id number;
--1.声明参数
--2.声明根据当前设置账簿的ID取得账户结构信息的游标
cursor sob_cur(sob_id number) is
select sob.set_of_books_id,
sob.currency_code,
sob.chart_of_accounts_id
from gl_sets_of_books sob
where sob.set_of_books_id=sob_id;
begin
-----------------------------------
--Get Set of Book Information
-----------------------------------
--从预制文件GL_SET_OF_BKS_ID 取得当前职责所属的账簿,如果娶不到相关信息,通过消息字典爆出错误消息
--Set Of Books ID
l_sob_id := fnd_profile.value('GL_SET_OF_BKS_ID');
if ( l_sob_id is null) then
fnd_message.set_name('FND','PROFILES-CANNOT READ');
fnd_message.set_token('OPTION','GL_SET_OFBKS_ID');
fnd_message.error;
raise form_trigger_failure;
end if;
--从预制文件ORG_ID 取得单调过去职责所属的操作单元(OU),若取不到则。。。
--org id
l_org_id :=fnd_profile.value('ORG_ID');
if (l_org_id is null) then
fnd_message.set_name('FND','PROFILES-CANNOT READ');
fnd_message.set_token('OPTION','ORG_ID');
fnd_message.error;
raise form_trigger_failure;
end if;
--执行游标,将信息取出到变量中,执行之后,记得关闭游标
open sob_cur(l_sob_id) ;
fetch sob_cur into l_sob_id, l_currency_code,l_coa_id;
close sob_cur;
--取出信息保存到参数块的变量中,以便后面的程序中使用:
:parameter.org_id :=to_number(l_org_id);
:parameter.set_of_books_id := to_number(l_sob_id);
:parameter.currency_code := l_currency_code ;
:parameter.chart_of_accounts_id := to_number(l_coa_id);
end pre_form;
when-new-form-instance:
--初始化Account弹性域的几个重要参数:
fnd_key_flex.define(
BLOCK=>'ORDER_LINES',
FIELD=>'ACCOUNT_DSP',
APPL_SHORT_NAME=>'SQLGL',
CODE=>'GL#',
ID=>'EXPENSE_ACCOUNT_ID',
DESCRIPTION=>'ACCOUNT_DESCRIPTION',
REQUIRED=>'N',
USEDBFLDS=>'N',
-- updateable=>'',
VALIDATE=>'FULL',
-- VRULE=>'\\nSUMMARY_FLAG\\nI\\nAPPL=SQLGL;NAME=GL_NO_PARENT_SEGMENT',
NUM=>':PARAMETER.CHART_OF_ACCOUNTS_ID');

浙公网安备 33010602011771号