Home » Developer & Programmer » Forms » Dynamically value (get roles) in combo box
Dynamically value (get roles) in combo box [message #443070] Fri, 12 February 2010 07:28 Go to next message
shahzad-ul-hasan
Messages: 454
Registered: August 2002
Senior Member
i want to get user (dba roles in combo box runt time).i have write down this code in when new form instance.
declare
  rg_id recordgroup := find_group('RG') ;
  ln_error number ;
begin
  if not id_null(rg_id) then
     ln_error := populate_group(rg_id) ;
     if ln_error = 0 then
        populate_list('BLOCK3.T' , rg_id) ;
     else
        message('Error in Populating Group') ;
     end if ;
  end if ;
end ;


pls see the attached file.when i run it gives the follwoing error.
frm-41334-invalid record group.
record group query is:
SELECT GRANTED_ROLE FROM DBA_ROLE_PRIVS WHERE GRANTEE='MTSYS'


[EDITED by LF: applied [code] tags and attached additional text after topics have being merged]
  • Attachment: combo.JPG
    (Size: 35.19KB, Downloaded 146 times)

[Updated on: Fri, 12 February 2010 07:37] by Moderator

Report message to a moderator

Re: Dynamically value (get roles) in combo box [message #443073 is a reply to message #443070] Fri, 12 February 2010 07:46 Go to previous messageGo to next message
Littlefoot
Messages: 20827
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Oracle
FRM-41334: Invalid record group for list population.

Cause: You tried to populate a list from a record group that does not exist.

Action: Make sure the record group exists.

Did you try to recompile (ALL) the form (<Ctrl + Shift + K>)?
Re: Dynamically value (get roles) in combo box [message #443076 is a reply to message #443073] Fri, 12 February 2010 07:59 Go to previous messageGo to next message
shahzad-ul-hasan
Messages: 454
Registered: August 2002
Senior Member
I HAVE CREATED A RECORD GROUP. YES I HAVE APPLIED CTRL+SHIFT+K. IT GIVE ME NO ERROR ON COMPLIATION. PLS CHECK THE ATTACHGED FILE.
  • Attachment: COMBO1.JPG
    (Size: 27.19KB, Downloaded 140 times)
Re: Dynamically value (get roles) in combo box [message #443110 is a reply to message #443076] Fri, 12 February 2010 12:29 Go to previous messageGo to next message
Littlefoot
Messages: 20827
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
But, this time it is called 'RECORD_GROUP2' and you are looking for 'RG', aren't you?
Re: Dynamically value (get roles) in combo box [message #443127 is a reply to message #443110] Fri, 12 February 2010 20:34 Go to previous messageGo to next message
shahzad-ul-hasan
Messages: 454
Registered: August 2002
Senior Member
yes sir,
i want to show user that i have created a record group name ('rg') in my posting picture.
Re: Dynamically value (get roles) in combo box [message #443151 is a reply to message #443127] Sat, 13 February 2010 01:13 Go to previous messageGo to next message
tamzidulamin
Messages: 132
Registered: October 2009
Location: Dhaka
Senior Member
Try with the following code:

Setp-01
CREATE TABLE MICR.Sample_List
( list_NAME          VARCHAR2(200 BYTE));


Setp-02
Insert into SAMPLE_LIST (LIST_NAME) Values ('T-List');
Insert into SAMPLE_LIST (LIST_NAME) Values ('Pop-List');
Insert into SAMPLE_LIST (LIST_NAME) Values ('Combo-Box');
Insert into SAMPLE_LIST (LIST_NAME) Values ('Other List');
COMMIT;


Setp-03

Declare           
    rg_name         varchar2(40) := 'RG'; 
    rg_id           recordgroup; 
    errcode         number; 
    vQuery          varchar2(4000):= 'select list_name,list_name from sample_list order by 1';
    p_list          varchar2(500) := 'BLOCK3.SAMPLE_LIST';
begin
            
      rg_id := find_group( rg_name ); 
    
      if id_null(rg_id) then 
           rg_id := CREATE_GROUP_FROM_QUERY( rg_name,vQuery);
      end if; 
         
      errcode             := populate_group( rg_id );
      clear_list    (p_list);
      populate_list (p_list, rg_id );
        
End; 


Step-04

Run the LIST.fmb form the attachment.

Now change your query as your required.

Regrads.
Tamzidul Amin.


Re: Dynamically value (get roles) in combo box [message #443152 is a reply to message #443151] Sat, 13 February 2010 01:15 Go to previous message
tamzidulamin
Messages: 132
Registered: October 2009
Location: Dhaka
Senior Member
find the attachment list.fmb.

tamzid.
  • Attachment: LIST.fmb
    (Size: 44.00KB, Downloaded 191 times)
Previous Topic: FRM-40737 what i can do .. ??
Next Topic: Menu Tree
Goto Forum:
  


Current Time: Tue Sep 27 21:12:01 CDT 2016

Total time taken to generate the page: 0.25951 seconds