利用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_LINES',update_allowed,property_FALSE);
set_block_property('TRN_ORDER_LINES',delete_allowed,property_false);
set_block_property('TRN_ORDER_LINES',query_allowed,property_FALSE);
--菜单
menu_p.menu_OFF('cancel');
menu_p.menu_OFF('close');
end if;
when 'SUBMITTED' then
if role_name = 'CUSTOM' then
-- fnd_message.debug('submmit');
set_item_property('TRN_CONTROL.SUBMIT_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_true);
--状态为SUBMITTED的时只能让'取消'订单有效 --lines
--LINES
set_block_property('TRN_ORDER_LINES',INSERT_ALLOWED,property_false);
set_block_property('TRN_ORDER_LINES',UPDATE_ALLOWED,property_false);
set_block_property('TRN_ORDER_LINES',DELETE_ALLOWED,property_false);
-- set_block_property('TRN_ORDER_LINES_4810_V',query_ALLOWED,property_false); menu_p.menu_off('close');
elsif role_name = 'MANAGER' then
set_item_property('TRN_CONTROL.ADOPT_BUTTON' , enabled , property_true);
set_item_property('TRN_CONTROL.REJECT_BUTTON' , enabled , property_true);
--
set_block_property('TRN_ORDER_HEADERS',insert_allowed,property_false);
-- fnd_message.debug('update_allowed_1');
set_block_property('TRN_ORDER_HEADERS',update_allowed,property_true);----------------------------------原为ture
-- fnd_message.debug('update_allowed_2');
set_block_property('TRN_ORDER_HEADERS',delete_allowed,property_false);
--set_block_property('TRN_ORDER_HEADERS_4810_V',query_allowed,property_true); -- set_item_property('TRN_ORDER_HEADERS.ORDER_STATUS' , update_allowed , property_false); --因为管理员可以进行备注所有把其中的一个ITEM改成可更改
-- fnd_message.debug('VENDOR_NUMBER_update_allowed_false_1');
set_item_property('TRN_ORDER_HEADERS.VENDOR_NUMBER' , update_allowed , property_false);
-- fnd_message.debug('VENDOR_NUMBER_update_allowed_false_2');
SYNCHRONIZE;
--set_item_property('TRN_ORDER_HEADERS_4810_V.VENDOR_NAME' , enabled , property_false);
set_item_property('TRN_ORDER_HEADERS.ORDER_DATE' , enabled , property_false);
--set_item_property('TRN_ORDER_HEADERS_4810_V.ORDER_STATUS' , enabled , property_false);--状态时在跳过来就改的,而在这里不能改。 set_item_property('TRN_ORDER_HEADERS.ORDER_NUMBER' , enabled , property_false);
--set_item_property('TRN_ORDER_HEADERS_V.ORDER_NUMBER' , insert_allowed , property_false);
-- fnd_message.debug('DESCRIPTION_update_allowed_false_1');
set_item_property('TRN_ORDER_HEADERS.DESCRIPTION' , enabled , property_true);
-- fnd_message.debug('DESCRIPTION_update_allowed_false_2');
--set_item_property('TRN_ORDER_LINES_4810_V.TOTALMONEY' , enabled , property_false);
set_item_property('TRN_ORDER_HEADERS.DF' , enabled , property_false); -- set_item_property('TRN_ORDER_HEADERS_4810_V.DESCRIPTION' , enabled , property_true); --LINES
set_block_property('TRN_ORDER_LINES',INSERT_ALLOWED,property_false);
set_block_property('TRN_ORDER_LINES',UPDATE_ALLOWED,property_false);
set_block_property('TRN_ORDER_LINES',DELETE_ALLOWED,property_false);
-- set_block_property('TRN_ORDER_LINES_4810_V',query_ALLOWED,property_false); --菜单
menu_p.menu_OFF('cancel');
menu_p.menu_OFF('close');
end if;
when 'APPROVED' then
if role_name = 'CUSTOM' then
set_item_property('TRN_CONTROL.SUBMIT_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_true); --lines
--LINES
set_block_property('TRN_ORDER_LINES',INSERT_ALLOWED,property_false);
set_block_property('TRN_ORDER_LINES',UPDATE_ALLOWED,property_false);
set_block_property('TRN_ORDER_LINES',DELETE_ALLOWED,property_false);
-- set_block_property('TRN_ORDER_LINES_4810_V',query_ALLOWED,property_false);
--这个里写订单的关闭菜单
menu_p.menu_off('cancel'); 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_true); --lines
--LINES
set_block_property('TRN_ORDER_LINES',INSERT_ALLOWED,property_false);
set_block_property('TRN_ORDER_LINES',UPDATE_ALLOWED,property_false);
set_block_property('TRN_ORDER_LINES',DELETE_ALLOWED,property_false);
-- set_block_property('TRN_ORDER_LINES_4810_V',query_ALLOWED,property_false); --菜单
menu_p.menu_OFF('cancel');
menu_p.menu_OFF('close');
end if;
when 'REJECTED' then
if role_name = 'CUSTOM' then
set_item_property('TRN_CONTROL.SUBMIT_BUTTON' , enabled , property_true); set_block_property('TRN_ORDER_HEADERS',insert_allowed,property_false);
set_block_property('TRN_ORDER_HEADERS',update_allowed,property_true);
set_block_property('TRN_ORDER_HEADERS',delete_allowed,property_false);--因为订单头的前提条件就是不能修改
set_block_property('TRN_ORDER_HEADERS',query_allowed,property_true); -- set_block_property('TRN_ORDER_lines_4810_V',update_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);
--写'取消,关闭'菜单
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_true); --lines
--LINES
set_block_property('TRN_ORDER_LINES',INSERT_ALLOWED,property_false);
set_block_property('TRN_ORDER_LINES',UPDATE_ALLOWED,property_false);
set_block_property('TRN_ORDER_LINES',DELETE_ALLOWED,property_false);
-- set_block_property('TRN_ORDER_LINES_4810_V',query_ALLOWED,property_false); --菜单
menu_p.menu_OFF('cancel');
menu_p.menu_OFF('close'); end if;
when 'CANCELLED' then
if role_name = 'CUSTOM' then
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_true);
--lines
--LINES
set_block_property('TRN_ORDER_LINES',INSERT_ALLOWED,property_false);
set_block_property('TRN_ORDER_LINES',UPDATE_ALLOWED,property_false);
set_block_property('TRN_ORDER_LINES',DELETE_ALLOWED,property_false);
-- set_block_property('TRN_ORDER_LINES_4810_V',query_ALLOWED,property_true); menu_p.menu_OFF('cancel');
menu_p.menu_OFF('close');
elsif role_name = 'MANAGER' then
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_true); --lines
--LINES
set_block_property('TRN_ORDER_LINES',INSERT_ALLOWED,property_false);
set_block_property('TRN_ORDER_LINES',UPDATE_ALLOWED,property_false);
set_block_property('TRN_ORDER_LINES',DELETE_ALLOWED,property_false);
--set_block_property('TRN_ORDER_LINES_4810_V',query_ALLOWED,property_false); menu_p.menu_OFF('cancel');
menu_p.menu_OFF('close');
end if;
when 'CLOSED' then
if role_name = 'CUSTOM' then
set_item_property('TRN_CONTROL.SUBMIT_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_true); --lines --LINES
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); menu_p.menu_OFF('cancel');
menu_p.menu_OFF('close');
elsif role_name = 'MANAGER' then
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_true); --lines --LINES
set_block_property('TRN_ORDER_LINES',INSERT_ALLOWED,property_false);
set_block_property('TRN_ORDER_LINES',UPDATE_ALLOWED,property_false);
set_block_property('TRN_ORDER_LINES',DELETE_ALLOWED,property_false);
-- set_block_property('TRN_ORDER_LINES_4810_V',query_ALLOWED,property_false); menu_p.menu_OFF('cancel');
menu_p.menu_OFF('close');
end if;
else
GO_BLOCK('TRN_ORDER_HEADERS');
end case;
end set_func_state; END;

FORM开发技术之动态控制某些item的属性的更多相关文章

  1. ios开发——实用技术总结Swift篇&swift常用开发技术总结

    swift常用开发技术总结 懒加载:属性,数组(字典),控件... 数组(懒加载): lazy var shops:Array<Dictionary<String, String>& ...

  2. 通俗易懂,什么是.NET?什么是.NET Framework?什么是.NET Core? .Net Web开发技术栈

    通俗易懂,什么是.NET?什么是.NET Framework?什么是.NET Core?   什么是.NET?什么是.NET Framework?本文将从上往下,循序渐进的介绍一系列相关.NET的概念 ...

  3. .NET Web开发技术简单整理

    在最初学习一些编程语言.一些编程技术的时候,做的更多的是如何使用该技术,如何更好的使用该技术解决问题,而没有去关注它的相关性.关注它的理论支持,这种学习技术的方式是短平快.其实工作中有时候也是这样,公 ...

  4. Web开发技术发展历史

    Web开发技术发展历史   来自:天码营 原文:http://www.tianmaying.com/tutorial/web-history Web的诞生 提到Web,不得不提一个词就是"互 ...

  5. Autodesk 最新开发技术研讨会 -8月22日-Autodesk北京办公室

    为了增进与广大中国地区Autodesk产品的二次开发人员的了解与互动,帮助中国地区的Autodesk产品二次开发人员了解Autodesk最新的二次开发技术动向,并获得Autodesk公司专业开发支持顾 ...

  6. 转载:.NET Web开发技术简单整理

    在最初学习一些编程语言.一些编程技术的时候,做的更多的是如何使用该技术,如何更好的使用该技术解决问题,而没有去关注它的相关性.关注它的理论支持,这种学习技术的方式是短平快.其实工作中有时候也是这样,公 ...

  7. WPF开发技术介绍

    本月做了一个小讲座,主要是WPF的开发技术介绍,由于是上班时间,去听的人不多,但对于自己来说至少是又巩固了Winform的知识,抽时间写一篇文章,在此分享给大家,有什么宝贵建议大家也可以提给我,谢谢. ...

  8. Windows开发技术的历史

    原文地址:http://www.kuqin.com/windows/20090315/40172.html Windows已经有22年的历史,这22年来,微软官方主力推行的编程语言与API有四个分水岭 ...

  9. iOS开发技术分享(1)— iOS本地数据存储

    iOS开发技术分享(1)— iOS本地数据存储 前言: 我本是一名asp.net程序员,后来加入了iOS游戏开发队伍,到现在也有一年多的时间了.这一年来,每天都干到2.3点钟才睡觉,不为别的,只为了学 ...

随机推荐

  1. rf常用关键字总结

    上传文件choose file 用法:choose file     元素定位          文件路径\\文件名 此处注意:复制的路径是/,需全部替换成\\ 清除Clear Element Tex ...

  2. CentOS搭建Apache+php+MySQL+Redis环境

    要搭建一个本地linux服务器环境,按照网络教程依葫芦画瓢,噼里啪啦搭好后,发现redis服务怎么也弄不好,不喜欢那种明知有问题却无从下手又无能为力的感觉,碰了无数次壁以后,我决定卸载,重头来过,并尽 ...

  3. LOJ #6031 字符串

    Description Solution 当 \(k\) 值较小时,发现询问串比较多,串长比较小 然后对 \(Q\) 个询问区间离线跑莫队,一次考虑每一个区间的贡献 假设一个区间 \([i,j]\) ...

  4. operator[] 和 insert

    operator[] 和 insert: map的[]操作和其他容器和内置[]没有关系 如果我们通过[]向map中插入or更新值,需要考虑一些东西 1.键已经存在,那么直接进行修改即可 2.键不存在, ...

  5. [BZOJ]1052 覆盖问题(HAOI2007)

    三矩形覆盖问题啊……不过听说FJOI还出过双圆覆盖问题? Description 某人在山上种了N棵小树苗.冬天来了,温度急速下降,小树苗脆弱得不堪一击,于是树主人想用一些塑料薄膜把这些小树遮盖起来, ...

  6. [BZOJ]4650 优秀的拆分(Noi2016)

    比较有意思的一道后缀数组题.(小C最近是和后缀数组淦上了?) 放在NOI的考场上.O(n^3)暴力80分,O(n^2)暴力95分…… 即使想把它作为一道签到题也不要这么随便啊摔(╯‵□′)╯︵┻━┻ ...

  7. bzoj1233[Usaco2009Open]干草堆tower 单调队列优化dp

    1233: [Usaco2009Open]干草堆tower Time Limit: 10 Sec  Memory Limit: 162 MBSubmit: 983  Solved: 464[Submi ...

  8. I/O控制的主要功能

    主要功能: 1.  解释用户的I/O系统调用.将用户I/O系统调用转换为I/O控制模块认识的命令模式. 2.  设备驱动.根据得到的I/O命令,启动物理设备完成指定的I/O操作. 3.  中断处理.对 ...

  9. C语言程序设计第二次作业--顺序结构

    C语言程序设计第二次作业--顺序结构 1.输出带框文字:在屏幕上输出以下3行信息. ************* Welcome ************* 源程序 #include <stido ...

  10. C语言程序设计第二次作业—————顺序结构改

    1.输出带框文字:在屏幕上输出以下3行信息. ************* Welcome ************* 源程序 #include <stido.h> int mian() { ...