babunagendra
asked on
View records in form 6i
The scenario is like this
I have three datablock in a formXX
First i open the A datablock and do a sreach for 'DUMMY' which will give me B block with the dummy data
now in that B block i have a COPY_TO button and when i press that it will give me C block
Now i enter data(ex: 12) in the C block and hit OK button which is in C block (that will close C block.)
And i want to go to B block and see only those rows which is i entered now (For example DUMMY data and 12)
I am saying GO_BLOCK(C)
EXECUTE QUERY;
But it shows all the values which entered by others also.
So i want to see only data entered by me in the B block.
Can somebody help me out here.
Thanks a lot in advance.
I have three datablock in a formXX
First i open the A datablock and do a sreach for 'DUMMY' which will give me B block with the dummy data
now in that B block i have a COPY_TO button and when i press that it will give me C block
Now i enter data(ex: 12) in the C block and hit OK button which is in C block (that will close C block.)
And i want to go to B block and see only those rows which is i entered now (For example DUMMY data and 12)
I am saying GO_BLOCK(C)
EXECUTE QUERY;
But it shows all the values which entered by others also.
So i want to see only data entered by me in the B block.
Can somebody help me out here.
Thanks a lot in advance.
One option is modifying DEFAULT_WHERE property of block B when hitting OK button in block C.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hi -Just realize- use block 'B' instead of C
:global.val1 := :field1; (DUMMY)
:global.val1 := :field2; (12)
go_block('B);
set_block_property('B',def ault_where ,' '||:field1 = :global.val1||' and '||:field2 = :global.val2||' ');
execute_query;
set_block_property('B',def ault_where ,' '');
:global.val1 := :field1; (DUMMY)
:global.val1 := :field2; (12)
go_block('B);
set_block_property('B',def
execute_query;
set_block_property('B',def
ASKER
S, i think i will try it out but what if they keep entering the data and want to see DUMMY,12 ,34,56,67,78,89..., like this
what i meant is i don't know how many field they want to enter, sometimes they have single project or 10 projects .so at that time how i will write the query.
Thanks.
what i meant is i don't know how many field they want to enter, sometimes they have single project or 10 projects .so at that time how i will write the query.
Thanks.
When a user clicks OK in the C block - you can loop through this block and can create the default_where property of block B like this:
DECLARE
var_where VARCHAR2(1000):=' ';
BEGIN
-- block C
FIRST_RECORD;
LOOP
var_where:=var_where||','| |:C.item1;
EXIT WHEN :SYSTEM.LAST_RECORD='TRUE' ;
NEXT_RECORD;
END LOOP;
var_where:=':field1 IN '||substr(var_where,2);
set_block_property('B',def ault_where ,var_where );
GO_BLOCK('B');
execute_query;
END;
DECLARE
var_where VARCHAR2(1000):=' ';
BEGIN
-- block C
FIRST_RECORD;
LOOP
var_where:=var_where||','|
EXIT WHEN :SYSTEM.LAST_RECORD='TRUE'
NEXT_RECORD;
END LOOP;
var_where:=':field1 IN '||substr(var_where,2);
set_block_property('B',def
GO_BLOCK('B');
execute_query;
END;
Not clear about your comments please elaborate more
How many such fields are there ?
do you mean to say DUMMY,12 ,34,56,67,78,89... are the different records, I.e If I entered 10 records now and When I go back to B , I need to see last 10 records one by one. Or does it mean there are differnt fields .
If you want more than one last records to see , then you might need to add one flag , so that system will know what is 'NEW .
Else you can have NVL function to drop NULL field , Or you can use If-Then
like
If :global.field1 is Not null Then
l_where_clause = l_where_clause ||' and '||:global.field1 = :field1
ElsIf :global.field2 is Not null Then
l_where_clause = l_where_clause ||' and '||:global.field2 = :field2
Like This
Please comment
How many such fields are there ?
do you mean to say DUMMY,12 ,34,56,67,78,89... are the different records, I.e If I entered 10 records now and When I go back to B , I need to see last 10 records one by one. Or does it mean there are differnt fields .
If you want more than one last records to see , then you might need to add one flag , so that system will know what is 'NEW .
Else you can have NVL function to drop NULL field , Or you can use If-Then
like
If :global.field1 is Not null Then
l_where_clause = l_where_clause ||' and '||:global.field1 = :field1
ElsIf :global.field2 is Not null Then
l_where_clause = l_where_clause ||' and '||:global.field2 = :field2
Like This
Please comment
ASKER
i think what u guys say might work for me, but
i wrote set_block_property('blockn ame' , defalut_where,...........X X)
....XX there what sholud i do
See i want is to see those records(DUMMY , project1,project2 all these record) created by that user . but not by any other
For ex A created project1,project2 and B who is another office created project 10 A should see project 1,project2 ,DUMMYand B should see project10,DUMMY.
i wrote set_block_property('blockn
....XX there what sholud i do
See i want is to see those records(DUMMY , project1,project2 all these record) created by that user . but not by any other
For ex A created project1,project2 and B who is another office created project 10 A should see project 1,project2 ,DUMMYand B should see project10,DUMMY.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
what i understood is i have to add an item createdby to block B and also to that item add a trigger when-New_form..,and assign gobal variable overthere
use this variable in var_where and what sholu i do with the Get_Application_Property(U SERNAME);
use this variable in var_where and what sholu i do with the Get_Application_Property(U
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
No what i wan to know is where should i say Get_Application_Property(U SERNAME);
I use it in a When-New-Form-Instance trigger.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.