Home » Developer & Programmer » Forms » Populating Data in List Item
icon5.gif  Populating Data in List Item [message #128104] Fri, 15 July 2005 02:28 Go to next message
master
Messages: 10
Registered: June 2005
Location: India
Junior Member
Hi,

I have created a item, CO_NAME as List Item and list style is Poplist.

I have written following code in when-new-form-instance
to populate the data from table to item.

DECLARE
rg_name VARCHAR2(40) := 'COMPANY';
rg_id RecordGroup;
errcode NUMBER;
BEGIN
rg_id := Find_Group( rg_name );
IF not Id_Null(rg_id) THEN
delete_group(rg_id);
END IF;

-- Creating the record group
IF Id_Null(rg_id) THEN
rg_id := Create_Group_from_query(rg_name,'select co_cd,co_name from m_company');
END IF;

-- Populating the record group
errcode := Populate_Group( rg_id );
-- Error occured while populating the record group
if errcode != 0 then
message(' Error occured while populating the record group');
raise form_trigger_failure;
end if;

-- Clearing the list before populating it.
clear_list('co_name');

populate_list('co_name',RG_ID);
exception
when no_data_found then
null;
when others then
null;
END;

But when I run the form, Oracle Error -
FRM-41337:Cannot populate the list from record group.

Any solution to resolve this ?
Re: Populating Data in List Item [message #128165 is a reply to message #128104] Fri, 15 July 2005 08:33 Go to previous messageGo to next message
vamsi kasina
Messages: 2112
Registered: October 2003
Location: Cincinnati, OH
Senior Member
Hi,
From Form's help:

POPULATE_LIST built-in

Description

Removes the contents of the current list and populates the list with the values from a record group. The record group must be created at runtime and it must have the following two column (VARCHAR2) structure:

Column 1: Column 2:
the list label the list value



So you need to select two columns as VARCHAR2.

by
vamsi
icon7.gif  Re: Populating Data in List Item [message #446295 is a reply to message #128104] Sun, 07 March 2010 11:48 Go to previous message
shrinivasarbatti
Messages: 1
Registered: March 2010
Location: HUBLI
Junior Member
I have found answer and i want to share with u

1) u have two list items A & B
2) you are populating list item A from form new instance trigger
3) populate list item B based on A
4) you are finding an error-FRM-41337 : Cannot populate list from record group

5) Dont worry-

Keep List Item A in one block
Keep List Item B in an another Block

It works

By

SHRINIVAS-NWKRTC 9632012022
Previous Topic: formating excel..
Next Topic: Trigger to check field value after query
Goto Forum:
  


Current Time: Fri Sep 20 10:21:10 CDT 2024