DYNAMIC LOV SETUP IN FORMS 6I

oracle India
  • 13 years ago

    Dear All,

     

    Please let me know the procedure of creating and using the Dynamic LOV's at RUNTIME. Also, if possible please mail @ itsonu82@gmail.com

  • 12 years ago

    may be this will help you to solve the problem 

     

    PROCEDURE PROC_LOV_OFF_BRANCH IS

     lov_id      LOV;
      rg_name  VARCHAR2(40) := 'branch_code_type';
      rg_id    RecordGroup;
      errcode  NUMBER;
      QERY VARCHAR2(1000);

    BEGIN
         if :global.gv_type = 'BO' THEN
          QERY := 'select branch_code,branch_name,type,region_code,region_name,
          controlling_code,cntr_name,ac_center_code,ac_name from fav_offices
          WHERE TYPE  = ''BO''AND REGION_CODE = :global.gv_REG_CODE
          AND CONTROLLING_CODE = :GLOBAL.GV_cntr_code
          AND AC_CENTER_CODE = :GLOBAL.GV_acct_code
          ORDER BY BRANCH_CODE';

         ELSIF :global.gv_type = 'CO' THEN
          QERY := 'select branch_code,branch_name,type,region_code,region_name,
          controlling_code,cntr_name,ac_center_code,ac_name from fav_offices
          WHERE TYPE  IN(''CO'', ''BO'')
          AND REGION_CODE = :global.gv_REG_CODE
          AND controlling_CODE = :GLOBAL.GV_cntr_code
          ORDER BY TYPE, BRANCH_CODE';

      ELSIF :global.gv_type = 'RO' THEN
          QERY := 'select branch_code,branch_name,type,region_code,region_name,
          controlling_code,cntr_name,ac_center_code,ac_name from fav_offices
          WHERE TYPE  IN(''CO'', ''BO'',''RO'')
          AND REGION_CODE = :global.gv_REG_CODE
          ORDER BY TYPE, BRANCH_CODE';
     
       END IF;
          rg_id := Find_Group( rg_name );
      
               IF not  Id_Null(rg_id) THEN
                 delete_group(rg_id);
                end if;
              rg_id := Create_Group_From_Query( rg_namE,QERY);
             errcode := Populate_Group( rg_id );

            lov_id     := Find_LOV('lov_def_reg');
           Set_LOV_Property(lov_id,GROUP_NAME,'BRANCH_CODE_TYPE');

      IF FORM_SUCCESS THEN
         DECLARE
         A BOOLEAN := FALSE;
         BEGIN
        LOOP
         EXIT WHEN A = TRUE;
         MESSAGE('Please choose one value to exit from list');
         A := SHOW_LOV('lov_def_reg');
        END LOOP;
         END;
        END IF;
    END ;

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away.” - Antoine de Saint Exupéry