Home » Developer & Programmer » Forms » display two department employee details at the same time in Master/Details Relation
display two department employee details at the same time in Master/Details Relation [message #603480] Mon, 16 December 2013 23:12 Go to next message
mist598
Messages: 1195
Registered: February 2013
Location: Hyderabad
Senior Member
Hi all,

How to display two department employee details at the same time in Master/Details Relation.Suggestion Please.

Thank You.
Re: display two department employee details at the same time in Master/Details Relation [message #603491 is a reply to message #603480] Tue, 17 December 2013 00:09 Go to previous messageGo to next message
Littlefoot
Messages: 21807
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Perform query in a master block so that it returns two (or more) departments; detail block will reflect these information.

How to do that?
  • enter query mode
  • enter ":a" into the DEPTNO item (":a" means that you want to query by a variable whose name is "a")
  • execute query
  • a new window will open; enter
    :a in (10, 20)
    (if you want to query departments 10 and 20) and click ... huh, <OK> I believe, but might be something else
  • detail block will be populated with data that belongs to the first department retrieved in the master block. You'll have to navigate to the next department (within the master block) in order to change information in the detail block (of course)
If you want to get employees that belong to both departments in the detail block at once (i.e. not separately by master block DEPTNOs), I'm afraid you can't do that - master-detail relationship won't allow you.
Re: display two department employee details at the same time in Master/Details Relation [message #603498 is a reply to message #603491] Tue, 17 December 2013 00:27 Go to previous messageGo to next message
mist598
Messages: 1195
Registered: February 2013
Location: Hyderabad
Senior Member
Hi Littlefoot,

The user will be able to select more than one dept Numbers from Dept Block and EMP block should display data accordingly. If user un select any department, that should reflect on EMP block dynamically.How can i ? suggestion Plz.


Thank you
Re: display two department employee details at the same time in Master/Details Relation [message #603502 is a reply to message #603498] Tue, 17 December 2013 01:08 Go to previous messageGo to next message
Littlefoot
Messages: 21807
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
You don't have to do anything. Master-detail relationship takes care about it.
Re: display two department employee details at the same time in Master/Details Relation [message #603568 is a reply to message #603480] Tue, 17 December 2013 07:54 Go to previous messageGo to next message
jgjeetu
Messages: 373
Registered: July 2013
Location: www.Orafaq.com/Forum
Senior Member

use the join criteria as job or any other column except deptno simple Cool

[Updated on: Tue, 17 December 2013 07:54]

Report message to a moderator

Re: display two department employee details at the same time in Master/Details Relation [message #603569 is a reply to message #603568] Tue, 17 December 2013 08:00 Go to previous messageGo to next message
cookiemonster
Messages: 13920
Registered: September 2008
Location: Rainy Manchester
Senior Member
Normally deptno is the only column in common between those two tables, so how exactly is that supposed to work?
Re: display two department employee details at the same time in Master/Details Relation [message #603610 is a reply to message #603568] Tue, 17 December 2013 23:32 Go to previous messageGo to next message
mist598
Messages: 1195
Registered: February 2013
Location: Hyderabad
Senior Member
Hi cookiemonster & jgjeetu,
The user will be able to select more than one dept Numbers from Dept Block and EMP block should display data accordingly. If user unselect any department, that should reflect on EMP block dynamically & Also, i attached .FMB file, so, please suggest me how to do that?


Thank You.
  • Attachment: MODULE2.fmb
    (Size: 52.00KB, Downloaded 1117 times)
Re: display two department employee details at the same time in Master/Details Relation [message #603614 is a reply to message #603610] Wed, 18 December 2013 00:10 Go to previous message
Littlefoot
Messages: 21807
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
The way you described it, this is NOT a true master-detail relationship. "Master" (DEPT) and "detail" (EMP) blocks are kind of related (because employees work in departments), but Forms master-detail works in a way that you select one master record which displays none, one or more detail records.

Therefore, don't create any kind of relationship (such as the one Forms Wizard creates).

As you want to select more than one department, I believe that you'll have to do the whole job manually: based on selected departments, create a WHERE clause for the "detail" block and set it using SET_BLOCK_PROPERTY & its ONETIME_WHERE or DEFAULT_WHERE. Then execute query in the detail block.
Previous Topic: FRM-40735:when-button-pressed trigger raised unhandled exception ORA-06502
Next Topic: Problem in Web.Show_Document
Goto Forum:
  


Current Time: Wed Apr 17 19:31:35 CDT 2024