FORM开发技术之动态控制某些item的属性

利用FORM内置函数控制ITEM包括按钮,普通ITEM等等的属性,更多内置函数学习课参考我的博客FORM内置系统函数 http://blog.csdn.net/cai_xingyun/article/details/17167189

PACKAGE BODY ROLE_CONTROL IS
  procedure set_func_role(role_name in varchar2) is --角色按钮控制
  begin
  	case upper(role_name)
  	 when 'CUSTOM' then
  	 		set_item_property('TRN_CONTROL.ADOPT_BUTTON',visible,property_false);
  	 		set_item_property('TRN_CONTROL.REJECT_BUTTON',visible,property_false);
  	 when 'MANAGER' then
				set_item_property('TRN_CONTROL.SUBMIT_BUTTON',enabled, property_false);--经理进入提交按钮设为enabled

  	 		set_item_property('TRN_CONTROL.ADOPT_BUTTON',visible,property_true);
  	 		set_item_property('TRN_CONTROL.REJECT_BUTTON',visible,property_true);	
  	 else
 				FND_MESSAGE.DEBUG('ROLE_NAME 角色名 不对!'); 	
  	end case;
  end set_func_role; 
  
  procedure set_func_state(role_name in varchar2,
  												 order_state in varchar2) is   --角色 + 状态 控制增删改
  begin
  	case upper(order_state)
  		when 'NEW'  then
  			if role_name = 'CUSTOM' then
  				
  				set_item_property('TRN_CONTROL.SUBMIT_BUTTON' , enabled  , property_true);
				--2. 通过角色控制来判断块是否可以删除
					set_block_property('TRN_ORDER_HEADERS',insert_allowed,property_true);
					set_block_property('TRN_ORDER_HEADERS',update_allowed,property_true);
					set_block_property('TRN_ORDER_HEADERS',delete_allowed,property_true);--因为订单头的前提条件就是不能修改
					set_block_property('TRN_ORDER_HEADERS',query_allowed,property_true);
					
					--LINES
					set_block_property('TRN_ORDER_LINES',INSERT_ALLOWED,property_true);
			  	set_block_property('TRN_ORDER_LINES',UPDATE_ALLOWED,property_true);
			  	set_block_property('TRN_ORDER_LINES',DELETE_ALLOWED,property_true);
					set_block_property('TRN_ORDER_LINES',query_ALLOWED,property_true);
					--菜单
					menu_p.menu_off('cancel');
					menu_p.menu_off('close');
					menu_p.menu_off('out');
  			elsif role_name = 'MANAGER' then
  						set_item_property('TRN_CONTROL.ADOPT_BUTTON' , enabled  , property_false);
					  	set_item_property('TRN_CONTROL.REJECT_BUTTON' , enabled  , property_false);
						
						 --在新建的时候只能进行查询
							set_block_property('TRN_ORDER_HEADERS',insert_allowed,property_false);
							set_block_property('TRN_ORDER_HEADERS',update_allowed,property_FALSE);
							set_block_property('TRN_ORDER_HEADERS',delete_allowed,property_false);
							set_block_property('TRN_ORDER_HEADERS',query_allowed,property_FALSE);
							--LINES
							set_block_property('TRN_ORDER_LINES',insert_allowed,property_false);
							set_block_property('TRN_ORDER
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值