Tree based on Record Group
Hi guys i have a tree that i populate using
FTREE.Set_Tree_Property(tree_item, FTREE.RECORD_GROUP, rg_Tree_Id); The problem is that my query is fine but the parent child relationships are not working.
The help on forms is terrible for trees and i cant find any information anywhere else.
As anyone any example of how this works?
my record group contains data such as this
child level parent
203096 1 203094
203097 1 203094
203098 1 203094
203099 1 203094
203100 1 203094
203101 1 203094
203102 1 203094
203103 1 203094
203104 2 203096
203105 2 203096
203106 2 203096
203107 2 203096
203108 3 203107
203109 4 203108 on displaying the tree the tree displays with all the information but the branches are in the order as above, they do not branch off the correct parent i.e. 203104 should branch off 203096 but it doesnt it branches off 203103 as this is the one above it, and the level is the only thing that has changed.
any ideas?
Hai,
In Tree, the values should be in the order.
that means,
parant 1 - 100000
child 1 100001
child 2 100002
parant 2 200000
child 1 200001
like that.
Regards,
Manu.
Similar Messages
-
Hierarchical Tree Data Query/Record Group Question
I need help with Hierarchical Forms right now. I'm currently trying to implement a hierarchical tree to display the different items in different categories. I have been reading up on it for the past few days, and i do not understand a few things.
What is the difference between a data query and record group? they seem the same to me.
How does the XX = prior XXX work? i understand that this is what connects the parent to the child.
How do you determine what depth the node is? its done in the record group/data query, but how do i decide what level it is dynamically?
Thanks a lot in advance!Thanks! I am unable to create a table specifically for the tree because i am using tables that have been ported live and are in use. My question about levels is how do I know which depth the node is. For example, i have a category called Information Technology and a category item called Business Informatics. I want to know how to decide that the Category(information technology) is on level 1 and the Item(business informatics) is on level 2.
Information Technology
|_
Business Informatics
And i do know how the Connect By XX = prior XXX works in the data query/record group.
Thanks for your help! -
I'm trying to achieve same thing as is done in metalink note 38358.1 but for some reason ON-* triggers are never called.
What settings do I have to set. Article just mentions "set block property 'use transactional triggers' to true", but in Forms 10g there is actually two places: DML and Query source where you can select "transactional triggers". Which one (or both) I have to set. Any other settings I have to check before those triggers will work?Funny, I created my block from scratch and now it works. Well, seems that this is standard behaviour in Forms - if something doesn't work do it again and it works... I have noticed that Forms Builder is not developer friendliest thing. (I think I last time added items before I setted up those transactional attributes, now I did it vice versa.)
But thank you for your help and time. -
Hi all
I have 2 records groups defined
based on a condition i want to populate the tree with a particular record group
I have assigned a record group in the property pallete of the tree
how can i populate the tree based on record group
Plzz help
thanks
RahulHi,
use following code on WHEN-NEW-FORM-INSTANCE
Declare
HTREE ITEM;
V_IGNORE NUMBER;
Begin
HTREE := FIND_ITEM(<Tree_block_name>);
V_IGNORE := POPULATE_GROUP(<Record_Group_Name>);
FTREE.SET_TREE_PROPERTY(HTREE, FTREE.RECORD_GROUP,<Record_Group_Name>);
end;
Hope this will helpful for you.
Thanks
Baloch
REWARDS: Please remember to mark helpful or correct posts on the forum, not just for my answers but for everyone!
Edited by: Baloch on Aug 2, 2010 5:04 PM -
Hello,
I am very new to Oracle Forms and have been tasked with pointing some forms we have to a new server and adding a couple of columns to come areas. Everything was going ok until I got to a the point where I have to add a new column to an area on a form. The forms are pointing to the new tables and the searches are working, or at least seem to be working. How can I tell the data source for a data group? I checked properties for the record group (RECORD_STATISTICS) that populates a certain area on a form and it has query selected as the record group type but there is no query showing. I added the column needed to the column specifications list but it does not show up when I run the form. There is a spot for it because the extra hyphen is there.
Here is the code that populates the fields on the form. The field I added is the ahs_site column. As mentioned earlier I added that field to the RECORD_STATISTICS data group as well as to all the procedures I can find but am missing something..
DECLARE
htree ITEM;
num_selected NUMBER;
current_node FTREE.NODE;
v_note_value number;
v_node_depth number;
total_rows number;
group_id RecordGroup;
v_selection_count NUMBER;
BEGIN
-- Find the tree itself.
htree := Find_Item('BLOCK_STATISTICS_TREE.TREE_ITEM_STAT');
v_selection_count := Ftree.GET_TREE_PROPERTY(htree, Ftree.SELECTION_COUNT);
IF v_selection_count>0 THEN
v_note_value := Ftree.Get_Tree_Node_Property(htree, :SYSTEM.TRIGGER_NODE, Ftree.NODE_VALUE);
IF v_note_value IS NOT NULL THEN
group_id := Find_Group('RECORD_STATISTICS');
total_rows := Get_Group_Row_Count(group_id);
v_node_depth := to_number(Get_Group_Number_Cell('RECORD_STATISTICS.NODE_DEPTH', v_note_value));
-- :BLOCK_BUDGET_PARAMETER.DI_SELECTED2 := v_node_depth;
GO_BLOCK('BLOCK_STATISTICS_DETAIL');
CLEAR_BLOCK;
FOR i in v_note_value..total_rows LOOP
IF v_node_depth=4 THEN
:BLOCK_STATISTICS_DETAIL.DI_TEMPLATE_SEQ := Get_Group_Number_Cell('RECORD_STATISTICS.NODE_SEQ', v_note_value);
:BLOCK_STATISTICS_DETAIL.DI_DESCRIPTION := Get_Group_Number_Cell('RECORD_STATISTICS.SITE', v_note_value)
|| ' - '|| Get_Group_Char_Cell('RECORD_STATISTICS.AHS_SITE',v_note_value)
|| ' - '|| Get_Group_Char_Cell('RECORD_STATISTICS.PRIMARY_CD', v_note_value)
|| ' - '|| Get_Group_Char_Cell('RECORD_STATISTICS.SECONDARY_CD', v_note_value)
|| ' - '|| Get_Group_Char_Cell('RECORD_STATISTICS.SECONDARY_CD_DESC', v_note_value);
:BLOCK_STATISTICS_DETAIL.DI_YR_AND_MNTH := Get_Group_Number_Cell('RECORD_STATISTICS.YR_AND_MNTH', v_note_value);
:BLOCK_STATISTICS_DETAIL.TI_QUANTITY_STAT := Get_Group_Number_Cell('RECORD_STATISTICS.QUANTITY', v_note_value);
ELSE
IF Get_Group_Char_Cell('RECORD_STATISTICS.LEAF_NODE', i)='Y'
AND v_node_depth < to_number(Get_Group_Number_Cell('RECORD_STATISTICS.NODE_DEPTH', i)) THEN
:BLOCK_STATISTICS_DETAIL.DI_TEMPLATE_SEQ := Get_Group_Number_Cell('RECORD_STATISTICS.NODE_SEQ', i);
:BLOCK_STATISTICS_DETAIL.DI_DESCRIPTION := Get_Group_Number_Cell('RECORD_STATISTICS.SITE', i)
|| ' - '|| Get_Group_Char_Cell('RECORD_STATISTICS.AHS_SITE',i)
|| ' - '|| Get_Group_Char_Cell('RECORD_STATISTICS.PRIMARY_CD', i)
|| ' - '|| Get_Group_Char_Cell('RECORD_STATISTICS.SECONDARY_CD', i)
|| ' - '|| Get_Group_Char_Cell('RECORD_STATISTICS.SECONDARY_CD_DESC', i);
:BLOCK_STATISTICS_DETAIL.DI_YR_AND_MNTH := Get_Group_Number_Cell('RECORD_STATISTICS.YR_AND_MNTH', i);
:BLOCK_STATISTICS_DETAIL.TI_QUANTITY_STAT := Get_Group_Number_Cell('RECORD_STATISTICS.QUANTITY', i);
Next_record;
ELSIF v_note_value<>i AND v_node_depth = to_number(Get_Group_Number_Cell('RECORD_STATISTICS.NODE_DEPTH', i)) THEN
EXIT;
END IF;
END IF;
END LOOP;
First_record;
END IF;
END IF;
END;
Hope that made sense. I do not understand how data flows through forms just yet or how to phrase my question in terms that understandable. I do have some screen shots I could send anyone willing to help.
Thank you.Adding a column to column specification does nothing.
First of all, check the record group query in record group properties:
1) In forms builder object tree find that record group, right-click > property palette.
2) Look for property (just cann't remember exactly its name) where select query is specified.
3) Add the column you need to the query. Column specification will refresh automatically.
There is one more way to specify query for record group. Look for calls of POPULATE_GROUP_WITH_QUERY procedure in the form code.
Forms 6i: menu program > find and replace pl/sql, Forms 10: edit > find and replace pl/sql. In the search field type POPULATE_GROUP_WITH_QUERY. Then see the results where your record group RECORD_STATISTIC is being populated programmatically. If no calls were found - the only data source is in record groups properties. -
Dynamically creating a Record Group based on Previously entered Record Grou
Forms [32 Bit] Version 10.1.2.3.0 (Production)
Hi,
I know how to dynamically create a record group based on a query and putting the code in When new form instance.
My query is. I have a form which has multiple Record Groups and the user wants to dynamically create subsequent groups based on previous groups.
For example
I have a record group with selects a Location,
when the user selects the Location from a list of values
the 2nd record group called 'Cost Centres' will have to filter out only those with the locations selected above.
How can I populate the 2nd record group at run-time when I do not know what site the user will select?
If I simply populate in when new form instance as in location and just select everything, the list of values populates.
CC field is a LIST ITEM and the list style is a POP LIST, it is not required.
I have put the code in the Location field in the when-list-changed trigger.
I am getting this error:
frm-41337: cannot populate the list from the record group
here is the code:
DECLARE
v_recsql Varchar2(1000); -- The SQL for creating the Record Group.
v_recgrp RecordGroup; -- Record Group
v_status Number; -- Return Value of Populate_Group function.
c_where VARCHAR2(1000);
BEGIN
IF :location = '1' THEN
c_where := ' substr(cost_centre,1,2) in (''01'',''02'')';
ELSIF :location = '2' THEN
c_where := ' substr(cost_centre,1,2) in (''02'',''03'')';
ELSIF :location = '3' THEN
c_where := ' substr(cost_centre,1,2) in (''01'',''11'',''07'')';
ELSE
c_where := ' 1=1'; --EVERYTHING
END IF;
v_recsql := 'SELECT cost_centre, description FROM cost_centres where '||c_where;
-- Create the Record Group
v_recgrp := CREATE_GROUP_FROM_QUERY('v_recgrp', v_recsql);
IF NOT ID_NULL(v_recgrp)
THEN -- No Error, record group has been successfully created.
-- Populate Record Group
v_status := POPULATE_GROUP('v_recgrp');
IF v_status = 0
THEN -- No Error. Record Group has been Populated.
POPULATE_LIST('block.CC', 'v_recgrp');
END IF; -- IF v_status = 0
-- Delete the Record Group as it is no longer needed.
DELETE_GROUP('v_recgrp');
END IF; -- IF NOT ID_NULL(v_recgrp)
END;thanks for your assistance.Hi,
Once record status gets change for block you can not populate/repopulate the list item. Keep those list items as non-database item with different names and create different items as database orignal items. Than assign the values in WHEN-LIST-CHANGE trigger to the actual database items.
-Ammad -
I'd like to create a hierarchy tree that display department name as the first level and all employees who works in that department as second level .Can anyone help me with the correct query ?
Any help would be thankful.Create a query based record group to populate tree.
An example:
select
initial_state,
depth,
label,
icon,
data
from
select *
from
select
-1 initial_state,
1 depth,
dept.deptno dcode,
dept.dname label,
'Dept' type,
dept.deptno data,
'your_dept_icon or NULL' icon
from dept
union
select
-1 initial_state,
2 depth,
emp.deptno dcode,
emp.ename label,
'Emp' type,
emp.empno data,
'your_emp_icon or NULL' icon
from emp
) order by dcode, type, label
GB -
Creation of Record Group and LOV at run time
Hello All,
I have been stuck by this...I have two text items on which LOVs have been placed.Selection of one depends on selection of other.I can dynamically create a record group but how to create a LOV dynamically to populate it with the dynamic record group been created.
For more visualization consider that filtering of data takes place in one lOV based on the other LOV been provided.
Revert ASAP...
Thanks and Regards,
Kapil UppalI don't think you can create a LOV dynamically, but you can repopulate a pre-existing one, which should allow you to achieve the same goal.
-
What are record groups for?
hi,
Could anybody tell me what is the main purpose of creating record groups whith statements like: create_group_from_query, populate_group, ...
Every time we want to access any records we can use blocks which are based on tables or views which are in Oracle Data Base. So what is the reason of creating record groups?
please explain my that issue:)
Grzegorzhi grzegorz,
Record Group is one which is used with LOVs and List Items.
for the use of LOV & List items u must have to define record group through whis the List items or LOV is belogs to that group.
A record group built from a query can store records from database tables much like a database view, with the added advantage that the record group is local to Form Builder, rather than existing in the database.
To know more about record group, form builder's help is good way,
Regards
Chandan -
Using Global variable in Record Group
Hi,
I have a requirement where in I need to pull a column name from a table and then use that value in the select statement of a record group. I have tried using global variables but it is not working. Here is the record group I would like to use.
RG_DOMAIN is based on LOV_DOMAIN
SELECT :GLOBAL.DOMAIN_COLUMN_NAME, DESCRIPTION FROM
DM_T_DOMAIN_VALUES
WHERE DOMAIN_NAME := BLOCK.ATTRIBUTE;
In the Key-Listval I have a select statement in which does this :
SELECT DOMAIN_COLUMN
INTO :GLOBAL.DOMAIN_COLUMN_NAME
FROM DM_T_DOMAIN_RULES WHERE DOMAIN_NAME = :BLOCK.ATTRIBUTE;
SHOW_LOV('LOV_DOMAIN');
The problem is I am not getting the value I am just getting the Domain_column name. For example for Domain_name 'CALC_TYP' the Domain_column is COLUMN_10 and I just see COLUMN_10 my LOV when I want to see the value of COLUMN_10 from the DM_T_DOMAIN_VALUES table.
I tried using Name_in and Copy but not working. Can anyone suggest a solution?
ThanksFrancois ,
I tried this but I am getting error saying record group does not exist. Can you tell me what should I go in Populate_group... and show_lov..maybe I am doing something wrong?
Declare
LC$Req Varchar2(512) ;
Begin
LC$Req := 'SELECT ' || :GLOBAL.DOMAIN_COLUMN_NAME || ' FROM ....' ;
Create_Group_From_Query( rg_group, LC$Req ) ;
Populate_group(RG_DOMAIN); ?? --- is this correct?
Show_Lov(LOV_DOMAIN) ; -- and is this correct?
End; -
Record Group In Insert Statement
Hi All,
I am using Oracle 9i Ver 2 & Developer 6i on Windows platform. I want to ask, can we pass a Form's Record Group object to a select statement as a whole. I mean something like this,
Suppose emp_rg is a Forms RecordGroup which has all the columns of scott.emp table & it contains 10 rows. So, can I write like this:
INSERT INTO emp VALUES(emp_rg);
Or anything like this, if this is wrong.
Or, I need to create a PL/SQL record object & then I can pass. Pls clarify.
Thanks in Advance,
Inderjeet SinghYes I often have trouble deciding whether to use a record group or a pl/sql table. They both have their own advantages in different situations. Manipulating record groups programatically requires rather more cumbersome syntax, but they do come with some handy built-ins (such as populate_group), and they also integrate with LOVs, Trees etc.
If you want the pl/sql table to be available throughout the form you will need to declare it in a package spec.
Even with a pl/sql table, you will need to write code to feed it into your insert statement. I reckon a global temporary table might allow the most straightforward syntax. -
How to create dynamic tree based on BAPI
Hi
I am able to create dynamic tree based on flat file structure example given in SDN . But how to create the tree from BAPI directly.Also when I will be clicking on any leaf node of the tree some data related to the node will be passed to another view.
Regards
AnandaWhat i'm trying to do is create an organizational structure.
Global>Region>Plant-->Corporation
The output from the RFC is a structure containing every possible combination for orgazational hierarchy. Basically a flat table with record for every possible combinaton of Region-Plant-Corporation. This data needs to be bound to a tree structure so that we can call BW queries based on that level. For example: Give me aged inventory for the SAP corporation within the plant Berlin that is located in the Europe region.
Now that you understand the business reason will the nodes that represent Region and Plant and corporation be non-singleton nodes or recursive? I was thinking a hierarchy of non-singleton nodes.
I can bind these nodes to the Region - Plant - Corporation elements returned from in the flat table structure. I will probably get duplicates as a specific Region will be listed multiple times for every possible combination of the data beneath it. I'm not so concerned about that right now as I want to make sure I understand how in Web Dynpro to bind the data to the tree.
Hopefully this makes some sense. Can you elaborate on how this may be constructed in context of the view?
Would i create a model node for region (0..n), model node for plant (0..n), and a model node for Corporation (0..n)?
Or does this sound totally incorrect?
julian
We have 3 regions over 50 plants and probably around 500 corporations. -
How to create Static Record group in Oracle Forms??
Dear All,
I have the following values V1,V2 to be placed in my list item field during DML operations.
I have an example to create the record group based on the table; whereas i have never tried for static value creation.
Could you please guide me how can i acheive this.?
Thanks ....
Regards,
Sunil.GThanks dhivya for your reply.
Actually what happens is; when i use the same methodology as you mentioned, it is asking me to set the Initial value.
Whereas in my applications; user has to manually select any of the values i.e eithe V1 or V2 for the first time.
Moreover i have found the query:-
I have created a static record group RG_VERSIONS i.e creating a new record group with the static values mentioning the "Column names " as "Version_label" which i have given the column values as "V1" and "V2" and then another column name as "Version_value" with the column values as "V1" and "V2".
Then i used the below query in the WHEN-NEW-FORM-INSTANCE trigger:-
PROCEDURE p_when_new_form_instance
IS
l_rg_id recordgroup;
l_item_id item;
BEGIN
--Populating value for Version Type based on static record group
l_rg_id := FIND_GROUP ('RG_VERSION');
IF NOT ID_NULL (l_rg_id)
THEN
l_item_id := FIND_ITEM ('BLOCKNAME.COLUMN_NAME');
POPULATE_LIST (l_item_id, l_rg_id);
END IF;
END p_when_new_form_instance;
Then it was working fine.
Thanks for your time.
Regards,
Sunil.G
Edited by: Sunil G on Jun 27, 2010 6:00 AM -
How to get query from a record group
HI
do we get the query from which record groupis based on in oracle forms with out checking in to the properties.Hello,
No, you cannot get the initial SELECT order from the Record Group.
Francois -
Hi,
I'm trying to create a form via JDAPI. I want to create a record group based on a SQL query.
// create record group (SQL query based)
RecordGroup rgSql = new RecordGroup(fmb, "RG_SQL");
rgSql.setRecordGroupType(JdapiTypes.REGR_QUERY_CTID);
// create the columns
RecordGroupColumn rgc1 = new RecordGroupColumn(rgSql, "PROJ_ID");
RecordGroupColumn rgc2 = new RecordGroupColumn(rgSql, "NAME");
// assign query
rgSql.setRecordGroupQuery("SELECT PROJ_ID, NAME FROM PROJECTS");
The record group is created at correct type, but the query is not assigned, either if I include the RecordGroupColumn-lines or not.
What am I doing wrong? Can anybody help.
AndreasYou're right, it's not very easy to find a reason for that ;-)
I'm trying out new features of Forms9i, so I am testing JDAPI as well.
The only reason I can imagine is that there is a big forms application of many hundreds of forms modules, and each of them has to be processed the same way.
For example, to each table of an application two new fields MOD_USER and MOD_DATETIME have been added to log data modifications. If these fields should be shown in the forms modules, you have to add new items in each form.
Andreas
Maybe you are looking for
-
Hi Guys: Mail has been doing weird stuff since I upgraded to Maverick. Today was a new one. I was composing and email to a friend and went to find an old related one. In doing a serch for it. I discoverd that the e:mail I was now composing was
-
HI Guys I am running SAP PI 7.1, My Scenario is to Send one XML file to 3 IDocs. I have created 3 Message Mapping and mapped the each IDoc, and when testing I am getting mapping Error on the Operation Mapping. My XML file has fields from different ID
-
How to use embedded font (CFF) for Flash CS4?
Hi, I am trying to embed "Arial Unicode MS" for use by TLF in my Flash CS4 project. As I googled around, I am using the "Flex SWC" approach, only not having any luck. Here is what I got: //Code in Flex ActionScript project: package public class F
-
Can't view achewood...
This may seem weird but I can't view the Achewood comic on my macbook pro, i haven't experienced this problem on any other computer mac or otherwise. I'm using ifrefox, the latest version and it still doesn't show, everything shows but the actual com
-
worked fine until today. When opening CS5 it says it can not locate any capable display drivers. Updated drivers (said they were fine), still won't load. Anyone have any ideas?