博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Dynamic View and Drop Down Menu
阅读量:5126 次
发布时间:2019-06-13

本文共 1280 字,大约阅读时间需要 4 分钟。

This was kind of interesting to figure out. What I was going after is the following. I had a drop down box on a page that shows some Business Units. The values however need to be dynamic and change depending on the user viewing/accessing the page.

For example, user1 should only see 52024, 12456 but user2 should be allowed to see 52024, 12456, 45648, and 10235.

To accomplish this I've created a table to store values for each user (lets call it TABLE_1). TABLE_1 has 2 fields (oprid, and business_unit). So now, we have 2 users on the table along with their associated business units.

The 2nd step is to create the dynamic view to pull business units specific to each user. The view will only have one field and that is the business_unit field.

 

On the Record Type tab choose Dynamic View and click "Click to open SQL Editor" to add your SQL view.

 

Your SQL will look something like this:

SELECT business_unit
  ,oprid
FROM
(
SELECT business_unit
             ,oprid
         
FROM TABLE_1
)
WHERE %oprclause

 

The %oprclause is what drives the dynamic view. At run time if the OPRID is in the view, %oprclause expands to OPRID='current operator' and therefore the view will only show values that are specific to the user viewing the page!

转载于:https://www.cnblogs.com/GoDevil/archive/2008/08/11/1265258.html

你可能感兴趣的文章
selenium+python3模拟键盘实现粘贴、复制
查看>>
第一篇博客
查看>>
typeof与instanceof的区别
查看>>
网站搭建(一)
查看>>
浅谈Linux下mv和cp命令的区别--转载
查看>>
SDWebImage源码解读之SDWebImageDownloaderOperation
查看>>
elastaticsearch
查看>>
postgreSQL 简单命令操作
查看>>
Spring JDBCTemplate
查看>>
Radon变换——MATLAB
查看>>
第五章笔记
查看>>
Notepad++如何真正启用自动缩进
查看>>
Iroha and a Grid AtCoder - 1974(思维水题)
查看>>
前端博客收藏
查看>>
python re模块
查看>>
python 面向对象(类的特殊成员)
查看>>
2015-2016规划
查看>>
关于linux下的.a文件与 .so 文件
查看>>
创建父子结构的Maven项目
查看>>
2015年蓝桥杯省赛A组c++第3题
查看>>