Re: Forms 4.5 PopLists Question

From: Michel Lapierre <milapier_at_ge.hydro.qc.ca>
Date: 1996/04/22
Message-ID: <Dq9KAy.K8p_at_ireq.hydro.qc.ca>#1/1


nickjost_at_mammoth.valleynet.com wrote-écrivait:

>This deals with Forms 4.5 Designer/2000 release. I have the following
>pre-form trigger:
 

>DECLARE
> Purch_Type_Code_List RecordGroup;
> Sale_Type_Code_List RecordGroup;
> List_ID1 Item := Find_Item('PURCH_TYPE_FK');
> List_ID2 Item := Find_Item('SALE_TYPE_FK');
> Status1 Number;
> Status2 Number;
>BEGIN
> Purch_Type_Code_List := Create_Group_From_Query('Purch_Type_IDs',
> 'SELECT to_char(purch_type.purch_type_pk),
> to_char(purch_type.purch_type_pk)
> FROM purch_type
> ORDER BY purch_type.purch_type_pk');
> Status1 := Populate_Group(Purch_Type_Code_List);
> Populate_List(List_ID1, Purch_Type_Code_List);
> Add_List_Element(List_ID1, 2, 'List2', '1');
> Delete_List_Element(List_ID1, 2);
>END;
 
>Now the frustrating part is that add_list and delete_list *work* but the
>populate_list gives the error:
> FRM-41337: Cannot populate the list from record group
 

>Suggestions more than welcome....

>Nick Jost
>Systems Analyst
>Standard-Rent-A-Car

Hi Nick,

First, I suggest that you use a record group instead of creating the group at runtime, that will eliminate the risk of sql error (syntax)

second, always check the return value of your fonctions like x = create_group, status... = populate_group, ... The value must be different from null when you're asking for an id (like list_id, group_id) and must be 0 (to be verify) when you fonction execute without error like the populate_group or list.

Third, I ran into the error you have because I had already items into my list. Populate_list should clear the list before populate (litterature) it but it seems it does not do it. So before doing a populate list, I always do a CLEAR_LIST(list_id)

Hope this help

Michel Lapierre
Oracle specialist Received on Mon Apr 22 1996 - 00:00:00 CEST

Original text of this message