1、先在公用对象中建立一个自定义的值集;
应用开发员->应用->查找->公用->新建一个公用对象
2、定义用户自定义的配置文件
应用开发员->配置文件->新集一个配置文件,使用上述的公用值集:SQL验证
SQL="select FL.LOOKUP_CODE, fl.meaning MEAN
INTO :PROFILE_OPTION_VALUE,
:VISIBLE_OPTION_VALUE
from fnd_lookup_VALUES fl
where fl.lookup_type='CUXXXXX' --为公用值集的名称
and fl.language='ZHS'"
COLUMN="MEAN(*)"
3、在Form表单中控制:
a、在Form级的WHEN-NEW-FORM-INSTANCE取得当前用户的权限值:
SELECT pov.profile_option_value
INTO :parameter.entry_pri_code -- 赋给Form表单中的自定义参数
FROM fnd_profile_options_tl pot,
fnd_profile_option_values pov,
fnd_profile_options fpo,
fnd_user fu
WHERE pot.user_profile_option_name='XXXX权限组'
AND fpo.profile_option_id=pov.profile_option_id
AND fpo.profile_option_name=pot.profile_option_name
AND pov.level_value=fu.user_id
AND pot.language=userenv('LANG')
AND pov.level_id=10004
AND fu.user_id=ln_user_id;
b、在BLOCK中控制数据的入口
如在when-new-record_instance中控制Data Block的属性
if :cux_project_info.entry_type_code='01' then
set_block_property('cux_pa_budget_occur_rate',update_allowed,property_false);
set_block_property('cux_pa_budget_occur_rate',delete_allowed,property_false);
set_block_property('CUX_PO_DISTRIBUTION_AMT_V',update_allowed,property_false);
set_block_property('CUX_PO_DISTRIBUTION_AMT_V',delete_allowed,property_false);
set_block_property('CUX_PO_DISTRIBUTION_AMT_V',insert_allowed,property_false);
begin
:cux_project_info.total_budget_occur_rate:=round(nv(:control.sum_contract_amount_01,0)/:cux_project_info.budget_amount*100,2);
exception
when others then
:cux_project_info.total_budget_occur_rate:=0;
end ;
:cux_project_info.contract_occur_amount:=:control.sum_contract_amount_01;
else
set_block_property('cux_pa_budget_occur_rate',update_allowed,property_true);
set_block_property('cux_pa_budget_occur_rate',delete_allowed,property_true);
set_block_property('CUX_PO_DISTRIBUTION_AMT_V',update_allowed,property_true);
:cux_project_info.total_budget_occur_rate:=:control.sum_budget_occur_rate_02;
end if;