ITPub博客

首页 > 数据库 > Oracle > Dynamically Change Record Group in Form

Dynamically Change Record Group in Form

原创 Oracle 作者:pan_tian 时间:2014-07-02 14:47:36 0 删除 编辑

From SQL Query

1. Create a Record Group(RG)

2. Create RG SQL Query as
Select 1,2,3,4,5 from dual;
Make sure you set the datatype accordingly w.r.t your col in the dynamic query to be used in the below package.
Here 1,2,3,4,5 represents the number of columns for your query
3. Create an LOV an attach this RG to it
4. Add the below logic to the trigger, Click on the field to which LOV is attached. it will show up.
DECLARE
  result Number;
  rec_id RecordGroup;
  rwcnt NUMBER;
  p_lovname VARCHAR2(40);
  p_rg_name VARCHAR2(40);
  lc_query VARCHAR2(1000);
BEGIN
  p_lovname := 
  p_rg_name := 
  lc_query:= \'SELECT
  item_name
  ,desc ,Attr1
  ,Attr2
  ,Attr3
  from ;
  
  rec_id := find_Group(p_rg_name );
  result := POPULATE_GROUP_WITH_QUERY(rec_id, lc_query);
  rwcnt := Get_Group_Row_Count(rec_id);
  SET_LOV_PROPERTY(p_lovname, GROUP_NAME, rec_id);
END;


From Existing Record Groups

Take serial number behavior as example,For different Txn Type,Then serial number LOV will dispaly different values,so we need to bind different record groups.
Sample Code like:
File:INVSLENT.pld       

         PROCEDURE set_rec_group (
         ... ...
         IF (trx_act = 1)
         THEN
            SET_LOV_PROPERTY (llov_name, group_name, \'inv_serial1\');
            SET_LOV_PROPERTY (to_serial_lov_name, group_name, \'inv_serial1\');
         ELSIF (trx_act = 2)
         THEN
            SET_LOV_PROPERTY (llov_name, group_name, \'inv_serial2\');
            SET_LOV_PROPERTY (to_serial_lov_name, group_name, \'inv_serial2\');
         ELSIF (trx_act = 3)
         THEN
            SET_LOV_PROPERTY (llov_name, group_name, \'inv_serial3\');
            SET_LOV_PROPERTY (to_serial_lov_name, group_name, \'inv_serial3\');
         ELSIF (trx_act = 4)
         THEN
            SET_LOV_PROPERTY (llov_name, group_name, \'inv_serial4\');
            SET_LOV_PROPERTY (to_serial_lov_name, group_name, \'inv_serial4\');
         ELSIF (trx_act = 5)
         THEN
            SET_LOV_PROPERTY (llov_name, group_name, \'inv_serial5\');
            SET_LOV_PROPERTY (to_serial_lov_name, group_name, \'inv_serial5\');
         ......





<!-- Baidu Button BEGIN -->

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/26687597/viewspace-1204547/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: Min-Max Planing Report Research
下一篇: Dual UOM in Oracle EBS
请登录后发表评论 登录
全部评论
暂无介绍

注册时间:2012-02-18

最新文章