Link to home
Start Free TrialLog in
Avatar of srigupta
srigupta

asked on

working with D2k record groups and LOVs at run time.

I need  to create a record group at run time that consists of customer names.  Users will select the customer name from the LOV and it will be displayed in the text item.  This is the reqd. functionality.

To accomplish this, I have written down the following codings in a trigger.
Kindly study this carefully.
The error thrown is mentioned aginst the particular line.
Can any one suggest me how to solve the problem.

DECLARE
     ONE_COL_RG_ID RECORDGROUP;
     COL_1 GROUPCOLUMN;
     RG_CREATED NUMBER;
     
BEGIN
     ONE_COL_RG_ID := FIND_GROUP('ONE_COL_RG');
     
     IF NOT ID_NULL(ONE_COL_RG_ID) THEN
          DELETE_GROUP_ROW(ONE_COL_RG_ID, ALL_ROWS);
          MESSAGE('FLUSHED THE EXISTING RECORD GROUP', ACKNOWLEDGE);
     END IF;
     
     IF ID_NULL(ONE_COL_RG_ID) THEN
          ONE_COL_RG_ID := CREATE_GROUP('ONE_COL_RG', GLOBAL_SCOPE, 25);
          MESSAGE('CREATED THE RECORD GROUP', ACKNOWLEDGE);
     END IF;
     
     COL_1 := ADD_GROUP_COLUMN(ONE_COL_RG_ID, 'NAME OF THE CUSTOMER',  CHAR_COLUMN, 50);

                    ---- <<Error thrown here (Error adding Group column)>>    
     RG_CREATED := POPULATE_GROUP_WITH_QUERY(ONE_COL_RG_ID, 'SELECT CUST_NAME FROM CUSTOMER_MASTER ' ||'ORDER BY CUST_NAME');
     
     IF RG_CREATED = 0 THEN
          MESSAGE('CREATED THE RECORD GROUP', acknowledge);
     END IF;

END;

     
     
Avatar of venkotch
venkotch

 If your record group contains static number of colums I will suggest rather to create a static record group based on dynamic select statement. If you do not know the number of columns in design time - then you can consider a dynamic regord group. However, you will not be able to display such a record group in a LOV.
  So, create a record group in the form, based on a query. In your query use bind variables to satisfy different result sets at runtime. Then create LOV, based on this record group and live will be easier.

Venko.
Avatar of srigupta

ASKER

dear venko,

I need to make my problem clear.  The main purpose of creating dynamic record groups in run time is that, We can create a single RG(record group) and LOV and design time and change it as many times as necessary at runtime to suit the results required for text items.  In my application, I have created a single RG (with one column) and similarly a single LOV.  This, I am trying to populate it at run time by taking data from database tables as the form requires.  I have no problem in displaying this dynamic LOVS.

The only problem is that, i could not add column header to the LOV.  The description for error number and error text has been given (Pls. verify my trigger codings, I have given earlier).  I now want to add a column header successfully.  How to do it?
dear venko,

I need to make my problem clear.  The main purpose of creating dynamic record groups in run time is that, We can create a single RG(record group) and LOV and design time and change it as many times as necessary at runtime to suit the results required for text items.  In my application, I have created a single RG (with one column) and similarly a single LOV.  This, I am trying to populate it at run time by taking data from database tables as the form requires.  I have no problem in displaying this dynamic LOVS.

The only problem is that, i could not add column header to the LOV.  The description for error number and error text has been given (Pls. verify my trigger codings, I have given earlier).  I now want to add a column header successfully.  How to do it?
dear venko,

I need to make my problem clear.  The main purpose of creating dynamic record groups in run time is that, We can create a single RG(record group) and LOV and design time and change it as many times as necessary at runtime to suit the results required for text items.  In my application, I have created a single RG (with one column) and similarly a single LOV.  This, I am trying to populate it at run time by taking data from database tables as the form requires.  I have no problem in displaying this dynamic LOVS.

The only problem is that, i could not add column header to the LOV.  The description for error number and error text has been given (Pls. verify my trigger codings, I have given earlier).  I now want to add a column header successfully.  How to do it?
ASKER CERTIFIED SOLUTION
Avatar of venkotch
venkotch

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
thanks venko,

I will work on this and give my comments.



srigupta