-
Hi,
I created my Data Block (Supply) and Layout (Windows/Canvases) using the Wizard, than I chg one of the control item frm Text Item to List Item (Property Palette -> Item Type). And I added the following code (below) into the WHEN-NEW-FORM-INSTANCE trigger to populate the list:
DECLARE
group_id RecordGroup;
list_id ITEM;
BEGIN
group_id := Create_Group_From_Query ('my_group', 'SELECT DeptName FROM Department');
list_id := Find_Item('DeptId');
IF (Populate_Group(group_id) = 0) THEN
Populate_List(list_id, group_id);
END IF;
END;
When I run my form it give me this error:
FRM-30351: No list elements defined for list item.
List DEPTID
Created form file C:\MP3\75131\TEST_LIST_ITEM.fmx
and this error:
FRM-41334: Invalid record group for list population.
What wrong with the code? I tried everything, but none of them work... could someone please help me out, I'm stucked... :(
Thank You.
Regard,
Wai Chong
-
An obvious point, but I presume the SQL is valid for the user who is connected to Forms ?
-
When you create/populate LIST_ITEM with record group you MUST have 2 elements in each row:
Data value and list item:
DECLARE
group_id RecordGroup;
list_id ITEM;
BEGIN
group_id := Create_Group_From_Query ('my_group', 'SELECT DeptName, DeptName FROM Department');
list_id := Find_Item('DeptId');
IF (Populate_Group(group_id) = 0) THEN
Populate_List(list_id, group_id);
END IF;
END;
SELECT DeptName, DeptName FROM Department
or
SELECT DeptName, DeptNo FROM Department
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|