|
|

楼主 |
发表于 2008/1/30 13:03:01
|
显示全部楼层
在這個 form 里我修改了以下幾個地方:
1. key-exit (form level)
--rcv_form_control.form_exit('KEY-EXIT');
bg_rcv_form_control.form_exit('KEY-EXIT');
---package "bg_rcv_form_control" 改自 "rcv_form_control", 把原來的 form 的名字改為我現在的
2. when-new-record-instance (data block level, under "HEADER" block)
bg_init_receipt_num('NEW'); --- add
3. pre-insert (data block level, under "HEADER" block)
bg_init_receipt_num('POST'); ---add
4. add procedure (program unit)
PROCEDURE BG_INIT_RECEIPT_NUM (p_event in varchar2) IS
v_sob_id number := null;
v_org_id number := null;
v_mtl varchar2(50);
v_exp varchar2(50);
v_mtl_name varchar2(50);
v_exp_name varchar2(50);
v_rec_num varchar2(30);
BEGIN
fnd_profile.get('GL_SET_OF_BKS_ID',v_sob_id);
begin
SELECT
v.pre_mtl_rcv, v.mtl_rcv_seq_name,
v.pre_exp_rcv, v.exp_rcv_seq_name
INTO v_mtl, v_mtl_name,
v_exp, v_exp_name
FROM gl_sets_of_books_dfv v,
gl_sets_of_books sob
WHERE v.row_id = sob.ROWID
AND v_sob_id = sob.set_of_books_id;
exception when others then
message('bg_init_receipt_num has exception', acknowledge);
null;
end;
if (v_mtl is not null and v_exp is not null) then
-- the customization setup is done, starts the initilization
if p_event = 'NEW' then
default_value('.','HEADER.RECEIPT_NUM');
set_item_property('HEADER.BG_RECEIPT_NUM',visible, property_true);
set_item_property('HEADER.RECEIPT_NUM',visible, property_false);
elsif p_event = 'POST' then
set_item_property('HEADER.BG_RECEIPT_NUM',visible, property_false);
set_item_property('HEADER.RECEIPT_NUM',visible, property_true);
FND_PROFILE.GET('MFG_ORGANIZATION_ID', v_org_id );
v_rec_num := bg_get_rcv_num (v_org_id, NAME_IN ('HEADER.ATTRIBUTE1'));
/*function bg_get_rcv_num is create in DB. it will return "column1||sequence"*/
COPY (v_rec_num, 'HEADER.RECEIPT_NUM');
end if;
end if;
END;
這里所提到的 RECEIPT_NUM 就是上圖的 “Receipt” |
|