• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1972
  • Last Modified:

Create global record group

Hello,
could someone help me to create global record group from form's names?
I am not lucky in adding non database items in record group :(

s.
0
Solve
Asked:
Solve
  • 9
  • 7
1 Solution
 
Helena Markováprogrammer-analystCommented:
The simpliest way is creating a table and put there forms names.
0
 
SolveAuthor Commented:
hm...
And could you help me to get out from the situation, in witch I am now? :)
If I won't be lucky - I will create a table from forms name..

If you remember, I need that global record group for not open the same form twice...

For example: I have a main form, there I created buttons, in witch when-button-pressed trigger I put open_form('F_nam1');

Here I have the name of form. Also I could get it :system.current_form (but this name I would have when form will be opened).

So, I have a value I need to insert into RecordGroup

In main's form WHEN-NEW-FORM_INSTANCE I created a record group:

declare
      rg_name VARCHAR2(40) := 'RG_FORM';
      rg_id RecordGroup;
      gc_id GroupColumn;
      n NUMBER;
      listItem Item := Find_item('Mygtukai.form_names');
      total_rows Number;
      new_row Number;
                FrmName VARCHAR2(40);
      
BEGIN

FrmName := 'F_name1';
rg_id := find_group(rg_name);
if id_null(rg_id) then
      rg_id := create_group(rg_name, global_scope);
      gc_id := add_group_column(rg_id, 'Name', char_column,50);
total_rows := get_group_row_count(rg_id);
new_row := total_rows + 1;
Set_Group_Char_Cell(gc_id, new_row,FrmName);

end if;

n := Populate_Group(rg_id);
PopulateList(listItem, rg_id);


end;
----
I want to populate in combobox these forms' names

I get an error:

41331: Invalid record group for list population
s.
0
 
Helena Markováprogrammer-analystCommented:
FRM-41331:  Could not delete element from %s.

Cause:      Caused by one of the following:

You tried to delete the other values element when the block contained either queried or changed records.

You tried to delete an element from a list that does not contain an other values element when the block contained either queried or changed records.

Action:      For more information, refer to help for restrictions on  CLEAR_LIST  and  DELETE_LIST_ELEMENT .

Level:      99

Type:      Error
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
SolveAuthor Commented:
But I am not trying to delete value from list?

s.
0
 
SolveAuthor Commented:
How to populate_group if it is not created from query?

s.
0
 
Helena Markováprogrammer-analystCommented:
I think that  FRM-41331 is only the last error caused by adding column to the record group. But global record group can be created only from query.
0
 
SolveAuthor Commented:
Now I also get an error:
FRM-40733: PL/SQL built-in SET_GROUP_CHAR_CELL failed

And removed global_scope

create_group(rg_name)
0
 
SolveAuthor Commented:
So, how to add text values to record group dinamicaly when?

s.
0
 
Helena Markováprogrammer-analystCommented:
...
 rg_skup := Find_Group('STROM');
 IF NOT Id_Null(rg_skup) THEN
  DELETE_GROUP(rg_skup);
 END IF;
 
 rg_selekt:='select 1,level,nazov,NULL,id from uzl_bod WHERE id IN (
 select distinct ID from uzl_bod start with ID in (
 Select id from uzl_bod where ID=:RIADIACI_MODUL.UZL_BOD_ID
 UNION ALL
 Select ID from uzl_bod where uzl_bod_id=:RIADIACI_MODUL.UZL_BOD_ID)
 connect by prior id=uzl_bod_id)
 start with uzl_bod_id is null connect by prior id=uzl_bod_id';
 
 rg_skup  := Create_Group_From_Query('STROM',rg_selekt);
/* columns STROM.ICRGGQ_0,STROM.LEVEL,STROM.NAZOV,STROM.NULL,STROM.ID */
 n_ignore := Populate_Group(rg_skup);
 n_ignore := Get_Group_Row_Count(rg_skup);

 IF n_ignore>0 THEN
-- to the 4th column letter 'A' is added
   gc_id := Find_Column( 'STROM.NULL' );
   IF NOT Id_Null(gc_id) THEN
     FOR i IN 1 .. n_ignore LOOP
            Set_Group_Char_Cell(gc_id,i,'A');
     END LOOP;
   END IF;
0
 
SolveAuthor Commented:
Understood.... but here you create you regord group from query
And if I have no to select from?
If you still have paciense :)
How to create non-query record group, dinamicaly add form name to record group?

s.
0
 
Helena Markováprogrammer-analystCommented:
You can read this topic in the on-line help - "Creating and populating non-query record group". There is all you need.
0
 
SolveAuthor Commented:
I made everything like "they say"

FrmName := 'F_NAME1';
rg_id := create_group(rg_name);
gc_id := add_group_column(rg_id, 'FormName', char_column,50);
ADD_GROUP_ROW(rg_id, END_OF_GROUP);
Set_Group_Char_Cell(gc_id, new_row,FrmName);

How could I see record groups records?

s.
0
 
Helena Markováprogrammer-analystCommented:
You can create a LOV and associate to it your record group.
0
 
SolveAuthor Commented:
I have to create record group first, and I create it only in form runtime ...
And I cant' create LOV dinamicaly.... so get an error FRM-30048: Unable to find record group .

Think I will drop this, because I am tired allredy and will let user to open 10000 times the same form

s.
0
 
Helena Markováprogrammer-analystCommented:
SET_LOV_PROPERTY built-in will do the work for you.
If you create a button and use SHOW_LOV built-in in a When-Button-Pressed trigger you will see your record group, too.
Also I would recommend you this topic "About list items" and especially RETRIEVE_LIST and POPULATE_LIST built-ins.
0
 
SolveAuthor Commented:
Thank you Henka for your patience very much!

s.
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 9
  • 7
Tackle projects and never again get stuck behind a technical roadblock.
Join Now