Home » Developer & Programmer » Forms » master-Detail (oracle forms 10g)
master-Detail [message #640000] Tue, 21 July 2015 04:26 Go to next message
sanodani
Messages: 98
Registered: October 2014
Member
Hallo all...

I am getting a Problem regarding Master-Detail block..

I have one master-block and 3 detail-blocks.
In my detail block1, i would like to display just those records which match my search criteria, not the others, even the control block object has many other records.

in my case: when i choose rcode=ct1 in my control-block then it should display (in detail-block1) just the record where class = 'MP' or 'SP'

Quote:
control block:
rcode

Detail block1:
field
desp
Sub

Detail block2:
email


my tables:

create table TT1 (
 rc  varchar2(20),
 usr varchar2(20)
);

create table TT2 (
 rc varchar2(20),
 rst number,
 field varchar2(20),
 def   varchar2(20)
);

create table TT3 (
 rc  varchar2(20),
 class varchar2(20),
 rst number
);

create table TT4 (
 rc varchar2(20),
 email varchar2(80)
);

----------------
insert into TT1 values ('ct1', 'mno');
insert into TT1 values ('pt1', 'pqr');

insert into TT2 values ('ct1',1, 'word', 'read text');
insert into TT2 values ('ct1',2, 'excel', 'write text');
insert into TT2 values ('ct1',3, 'word', 'make text');

insert into TT3 values ('ct1', 1, 'MP');
insert into TT3 values ('ct1', 2, 'SP');
insert into TT3 values ('ct1', 3,'BD');
insert into TT3 values ('ct1', 4,'AB');

insert into TT4 values ('ct1', 'abc@abc.com');


which trigger should i use or where should i use this trigger or any other idea?
can anyone please have some idea/suggestion?

thankx in advance

regards,
Re: master-Detail [message #640071 is a reply to message #640000] Tue, 21 July 2015 14:24 Go to previous messageGo to next message
Littlefoot
Messages: 21808
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Compose your own WHERE clause in a PRE-QUERY trigger. Use SET_BLOCK_PROPERTY and its ONETIME_WHERE.
Re: master-Detail [message #640085 is a reply to message #640071] Wed, 22 July 2015 00:52 Go to previous messageGo to next message
sanodani
Messages: 98
Registered: October 2014
Member
Hallo Littlefoot

Thankx for your Suggestion.

I am still bit confused, where i should put this pre-query Trigger?

I tried in the block where my where clause field is.

i wrote this Trigger in block level:

set_block_property('block_name', onetime_where, 'field_name = '' email''');

but it did not work :/

can you please tell me, where is my fehler?
thanking you alot.
regards
Re: master-Detail [message #640087 is a reply to message #640085] Wed, 22 July 2015 01:29 Go to previous messageGo to next message
sanodani
Messages: 98
Registered: October 2014
Member
Thankx Smile Littlefoot

yes, it works now, i put the pre-query Trigger in the block where my where clause was.. Smile

thankx for your Help and Suggestion Smile

regards,
Re: master-Detail [message #640094 is a reply to message #640087] Wed, 22 July 2015 04:09 Go to previous messageGo to next message
sanodani
Messages: 98
Registered: October 2014
Member
Hallo..

as i have written above that it works now but, i still have some Problem..
i wrote pre-query Trigger in my Detail block

set_block_property('Detail_block1', onetime_where, 'class in (''MP'', ''SP'')');

and when i run my forms, it just Display one record that belongs to first where clause, (for example: where class = 'MP') but some records have two or many records ( with both where clause: 'MP' and 'SP') which also need to Display in Detail block as well.

Can anyone please help me in this regards, please?

thanking you.

Re: master-Detail [message #640172 is a reply to message #640094] Thu, 23 July 2015 05:02 Go to previous message
Littlefoot
Messages: 21808
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
The way you put it, it doesn't work as the master-detail relationship because it doesn't take care about master block's value. Whatever you put into master block and execute query, detail block will use your ONETIME_WHERE, and there's no reference to master block's item(s).
Previous Topic: relation master-detail
Next Topic: check box
Goto Forum:
  


Current Time: Thu Apr 25 18:58:02 CDT 2024