Forum Stats

  • 3,824,920 Users
  • 2,260,440 Discussions
  • 7,896,348 Comments

Discussions

List item and record group

user5108636
user5108636 Member Posts: 1,753 Silver Badge

I am following the forms help content to create a list from a record group. Below is documentation

Adding Multiple List Elements

 To replace the elements in the List item completely, use the POPULATE_LIST Built-in subprogram. This subprogram removes the contents of the current List item and then populates the List item with the values from a record group. 

A record group is an internal Oracle Forms data structure that has a column/row framework similar to a database table. One advantage to populating a List item with record group values is that record groups (query and non-query) can be constructed dynamically at runtime. 

Note: In order to populate a List item from a record group, the record group must be created at runtime and it must have two columns with type CHAR. Column one must contain List label values and column two must contain List element values. 

When you call POPULATE_LIST, you indicate which List item will receive the record group values by specifying List ID and record group name. 

Adding multiple List elements Examples 



The following example creates a two column query record group and then populates a List item with the values from the record group. 


DECLARE 

group_id RecordGroup;

List_id Item := Find_Item('List_item1'); 

status NUMBER; 

BEGIN 

/* 

** Create a two column query record group called

** product_name. 

*/ 

group_id := Create_Group_From_Query('product_names','SELECT 

product.name, product.name FROM product'); 

status := Populate_Group('product_names'); 

/* 

** Populate the List item with the values from the 

** product_name record group. 

*/ 

Populate_List(List_id,group_id); 

END; 


I incorporated this list item into my form, the list seems to load up at times. But intermittently getting this error. An unexpected error has occured. Contact support Quote error FRM-40735

My record group query is below, which seems to be alright

rg_testamurtype := Create_Group_From_Query('testamur_types', 'SELECT testamur_type.testamur_type, testamur_type.description  from testamur_type

                       where closed_ind = ''N'' order by testamur_type.description');


Please advise how to debug this.

Comments

  • user5108636
    user5108636 Member Posts: 1,753 Silver Badge
    edited Jun 10, 2022 7:48AM

    Please not there is no client server setup with debugger port open at the organization for debugging.

  • Michael Ferrante-Oracle
    Michael Ferrante-Oracle Senior Principal Product Manager USMember Posts: 7,194 Employee

    Exactly which Forms version are you using?

    The debugger would not be of much help in such a case unless you believe the issue is in your own code.

    Likely the issue is related to the data being returned. Either no data is returned or one or more columns contain data to wide to populate based on the properties of the list item. In other words if the field is configured to have a max length of 10 but the data returned is 11 characters you might get an error.


    Michael Ferrante

    Senior Principal Product Manager

    Oracle

    Twitter: @OracleFormsPM

  • user5108636
    user5108636 Member Posts: 1,753 Silver Badge

    Using Forms 12.2.1.3. I checked the max length which 60 and the values are nowhere close to that.

  • user5108636
    user5108636 Member Posts: 1,753 Silver Badge

    Also, get this error FRM-40735: WHEN-BUTTON-PRESSED Trigger Raised Unhandled Exception ORA-06502

    when I click on the help button. Please advise

  • Michael Ferrante-Oracle
    Michael Ferrante-Oracle Senior Principal Product Manager USMember Posts: 7,194 Employee

    ORA-06502 implies that a data value being return is not of a supported datatype or other numeric issue. A simple example would the case where for example the object (list item) datatype is set to NUMBER but data being returned is a non-numeric value (e.g. ABC)


    Michael Ferrante

    Senior Principal Product Manager

    Oracle

    Twitter: @OracleFormsPM

  • user5108636
    user5108636 Member Posts: 1,753 Silver Badge

    The datatype return by the record group, both columns are varchar2. Please advise, how to troubleshoot

  • Michael Ferrante-Oracle
    Michael Ferrante-Oracle Senior Principal Product Manager USMember Posts: 7,194 Employee

    Create a new module for testing purposes. In the new module add a list item and a button to a canvas. Using the Record Group Wizard, create a record group using the same/similar query to the one you were trying to use in code. In the button WHEN-BUTTON-PRESSED trigger, add:

    Populate_List(List_name,group_id);

    Of course include the real list name and RG name.

    Do not add any other code to the form. Run it. Does it reproduce the same problem?


    Michael Ferrante

    Senior Principal Product Manager

    Oracle

    Twitter: @OracleFormsPM