This content has been marked as final. Show 7 replies
In each Data Block there are three nodes - triggers, items, and relations. The relations node is what you use to link the master to the detail. If you highlight the Relations node and press create a window will open to create your "New Relation". The master block is already entered because it is the block that you are currently in. You can then pick a detail block by pressing the "select..." button or just type the name of the block in. So if you did this in block A, you would enter B as your detail block. You will then need to enter a join condition. If the PK in block A is named A_DETAIL and the FK in block B is the same name, then you can just type in A_DETAIL, press OK, and the relationship will be automatically created. If the names are different then you could put in a join condition like A.A_DETAIL = B.B_A_DETAIL (whatever the names of the blocks and items are). You can then repeat this process for every parent-child relationship.1 person found this helpful
Hi,1 person found this helpful
In the example you mentioned B is the child table of master tables A,C and C is the child table of D.
Now in the block properties of A create a relation with B by giving equi join.
Similarly in the B block create relation with C,D (if B has the foreign key of D) else create a similar relation between B and C, C and D.
Now if query master block A, show some data from block B, C and D that is corresponding to block A.
I hope this will work. :)
I joined every parent/child in master/detail relationship (again like I did before) and when I run the form and query A it only shows details from B, and details from C and D are empty.
So when I make master/detail relationship can I change it this time and make child-the master and parent-the details or something?
Thanks for ressponding so quickly
I think you are missing one of the relationships.1 person found this helpful
If A is a parent of B then you need to create a relationship in the A block where you join A to B.
Which is the next relationship?
It sounds like D is a parent of C so would have to create another relationship in the D block to join with C.
At this point you have A tied to B and you have D tied to C, but now you need to link them together. Which is the parent?
From what I could tell you need to link B to C, so if B is the parent then you would create a relationship in the B block to join to C.
Once they are all linked, when you query data into A, they should all trickle down and populate.
But C is the parent of B, B takes FK from C and also A (B has two FK) and this is the problem if B was a parent it would be easy.
This is confusing. So if I have this right:
A and C are parents of B
D is a parent of C
If that is true, when you query data into A it will never be able to populate D and C because there is not a relationship between A, C, and D.
You've got it right.This is the assignment i've got and i can see in a jpg file, that goes with it, how the finished form looks like.
It doesn't make sense.
Thanks for your help