Home » Developer & Programmer » Forms » populate_list (forms 6i)
populate_list [message #396111] Sat, 04 April 2009 00:59 Go to next message
sivajyothi.kalikiri
Messages: 29
Registered: March 2009
Junior Member
I had 2 listboxes, list_bank and list_accountno

what's my requoremwnt is i have to populate list_accountno
depending on list_bank. I should get the all the accountno's in list_accountno correspnding to list_bank.

I wrote the following code in when-new-item-instance trigger of list_accountno


DECLARE
v_record_group_name VARCHAR2(50) := 'Rec_Names';
v_record_group_id RECORDGROUP;
v_err_code NUMBER;
v_sql VARCHAR2(1000);
BEGIN
v_sql :=
'SELECT mbm.bank_ac_no
FROM m_bank_mst mbm,m_bank_name mbn
WHERE mbn.bank_code = mbm.bank_code
AND mbn.bank_code =:approval_block.bank_code';
v_record_group_id := find_group( v_record_group_name );
IF id_null( v_record_group_id )
THEN
v_record_group_id := create_group_from_query( v_record_group_name,v_sql);
ELSE
delete_group( v_record_group_id );
v_record_group_id := create_group_from_query( v_record_group_name, v_sql );
END IF;
v_err_code := populate_group( v_record_group_id );
IF v_err_code = 0
THEN
populate_list('APPROVAL_BLOCK.LIST_ACCOUNTNO', v_record_group_id );
END IF;
END;


But i am not getting any values in that list_accountno.
what's wrong in my code?

[Updated on: Sat, 04 April 2009 01:01]

Report message to a moderator

Re: populate_list [message #396130 is a reply to message #396111] Sat, 04 April 2009 02:00 Go to previous messageGo to next message
vamsi kasina
Messages: 2107
Registered: October 2003
Location: Riyadh, Saudi Arabia
Senior Member
Issue is with the code
v_sql :=
'SELECT mbm.bank_ac_no
FROM m_bank_mst mbm,m_bank_name mbn
WHERE mbn.bank_code = mbm.bank_code
AND mbn.bank_code =:approval_block.bank_code';
Change this to
v_sql :=
'SELECT mbm.bank_ac_no,mbm.bank_ac_no
FROM m_bank_mst mbm,m_bank_name mbn
WHERE mbn.bank_code = mbm.bank_code
AND mbn.bank_code =:approval_block.bank_code';
If the back_ac_no is not char field use to_char.

By
Vamsi
Re: populate_list [message #396132 is a reply to message #396130] Sat, 04 April 2009 02:29 Go to previous messageGo to next message
sivajyothi.kalikiri
Messages: 29
Registered: March 2009
Junior Member
I tried that also, but not working.
bank_ac_no is a varchar2 field only

[Updated on: Sat, 04 April 2009 02:30]

Report message to a moderator

Re: populate_list [message #396136 is a reply to message #396132] Sat, 04 April 2009 04:29 Go to previous message
vamsi kasina
Messages: 2107
Registered: October 2003
Location: Riyadh, Saudi Arabia
Senior Member
There is some example in this link.
Try to write this code in when-list-changed of the other list item.

If not working try more debug messages.

By
Vamsi
Previous Topic: Open REF CURSOR ==> "this feature is not supported in client side programs"
Next Topic: color picker in form 6i
Goto Forum:
  


Current Time: Sat Dec 10 11:10:47 CST 2016

Total time taken to generate the page: 0.11707 seconds