Home » Developer & Programmer » Forms » how to programatically change relationship in master-detail block (form 6i on windows deploy on EBS 11.5.10)
how to programatically change relationship in master-detail block [message #573033] Thu, 20 December 2012 02:01 Go to next message
chanokchai
Messages: 11
Registered: December 2012
Location: thailand
Junior Member

hi guys

can we use set_block_property to program to switch multiple relationships. for example

if true then use relationshipA
else relationshipB
end if;

or something like this?

Thanks in advance!
Bank
Re: how to programatically change relationship in master-detail block [message #573034 is a reply to message #573033] Thu, 20 December 2012 02:05 Go to previous messageGo to next message
Littlefoot
Messages: 19526
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Open Forms Help and read what's offered in SET_BLOCK_PROPERTY. I don't think that property you are talking about exists.

However, if you explain what problem you are trying to solve, someone might suggest a solution.
Re: how to programatically change relationship in master-detail block [message #573036 is a reply to message #573034] Thu, 20 December 2012 02:21 Go to previous messageGo to next message
chanokchai
Messages: 11
Registered: December 2012
Location: thailand
Junior Member

ok thanks littlefoot

my requirement is
:BLK1 master and :BLK2 is detail.
I want to query :BLK1 and then :BLK2 return data with different joining-condition. Depends on some values of :BLK1

I doing master-details by using standard relationship property.
if there is no standard way of changing block property, Should I manually control master-details query by coding? and how to do it?.

appreciate your help sir!
Bank
Re: how to programatically change relationship in master-detail block [message #573037 is a reply to message #573036] Thu, 20 December 2012 02:24 Go to previous messageGo to next message
Littlefoot
Messages: 19526
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
I'd suggest you to use SET_BLOCK_PROPERTY and modify BLK2's DEFAULT_WHERE (or, possibly, ONETIME_WHERE) property. It is designed exactly for what you need.
Re: how to programatically change relationship in master-detail block [message #573038 is a reply to message #573037] Thu, 20 December 2012 02:38 Go to previous messageGo to next message
chanokchai
Messages: 11
Registered: December 2012
Location: thailand
Junior Member

meaning i have to remove default relationship? because 2 join-condition conflict each other.

your solution seem to work if change relationship function to default_where property.
but problem is if remove relationship, how to make details block auto query after we execute_query master block?

thanks for quick reply!
Bank
Re: how to programatically change relationship in master-detail block [message #573040 is a reply to message #573038] Thu, 20 December 2012 02:49 Go to previous messageGo to next message
Littlefoot
Messages: 19526
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Why would you remove relationship? If you do that, you break master-detail relationship.

This is how I understood the problem: BLK1 is a data block based on some table. BLK2 is a data block based on another table. These two tables are (or should be) created in a manner that master-detail relationship exists in the database itself (not only in your form). Therefore, it (a relationship) is a constant, you don't change it.

Then you go to Forms and create a master-detail form. Forms is smart and recognizes relationship in the database and creates the one in your form. If you run the form, master-detail relationship takes care about correct data fetch in the detail block.

So far, so good.

What do you want to do now?
Re: how to programatically change relationship in master-detail block [message #573041 is a reply to message #573040] Thu, 20 December 2012 02:58 Go to previous messageGo to next message
chanokchai
Messages: 11
Registered: December 2012
Location: thailand
Junior Member

ok let's me explain real scenario

relationshipA is linking master-detail by linking PERSON_ID <-- default relashipship
relationshipB is linking master-detail by linking ORG_ID

now if I add default_where in detail block to relationshipB. how details block query condition be? by ORG_ID or by PERSON_ID or both? hope I understand what I doubt.

thanks!
Re: how to programatically change relationship in master-detail block [message #573045 is a reply to message #573041] Thu, 20 December 2012 03:32 Go to previous messageGo to next message
Littlefoot
Messages: 19526
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Well, without seeing how these tables look like, it is kind of difficult to guess.

I'd say that ORG_ID should be default relationship, and then - if you wish - you can further restrict selection by people. Because - people work in organizations, it is not the opposite.

Suppose that you use PERSON_ID for relationship: what kind of data do you display in master, and what kind of data in detail block?

Suppose that you use ORG_ID for relationship: what kind of data do you display in master, and what kind of data in detail block?
Re: how to programatically change relationship in master-detail block [message #573648 is a reply to message #573045] Tue, 01 January 2013 21:37 Go to previous messageGo to next message
chanokchai
Messages: 11
Registered: December 2012
Location: thailand
Junior Member

hi
Both view is totally different so what I have done is leave behind master-detail relationship function and change to set_block_property where cause. Now it's doing well. thanks so much
Re: how to programatically change relationship in master-detail block [message #573654 is a reply to message #573648] Wed, 02 January 2013 00:08 Go to previous message
Littlefoot
Messages: 19526
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Thank you for the feedback!
Previous Topic: Copy
Next Topic: Problem with Forms FRM-40105
Goto Forum:
  


Current Time: Sat Aug 30 11:24:28 CDT 2014

Total time taken to generate the page: 0.10476 seconds