Dynamically Change Record Group in Form

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 := <LOV_name>
  p_rg_name := <RG_Name>
  lc_query:= 'SELECT
  item_name
  ,desc ,Attr1
  ,Attr2
  ,Attr3
  from <Your tab name>;
  
  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');
         ......





评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值