tmas73 Posted August 16, 2006 Posted August 16, 2006 (edited) I have a problem to show the Fields from the "Inventory" tabe to show up in the "Contacts" Table. I created the "Inventory" fields in the contact table but none show, is it a relation problem? How can I get those relations to work? Thanks for the help Thomas Graph.pdf Edited August 16, 2006 by Guest
LaRetta Posted August 16, 2006 Posted August 16, 2006 It is difficult to tell by your example. We will need to know the relationship keys involved. What fields relate them? Please provide field names and the data types and whether the fields are global, calculation, unstored, indexed and so on. Have you double-clicked each field in that portal and made sure they are also based upon the Inventory table occurrence? If they are, then your relationship probably isn't working.
tmas73 Posted August 16, 2006 Author Posted August 16, 2006 (edited) I guess it is not but how can I relate it? It only allowes me to connect one connection, it asks me to make a copy of contacts or inventory! Contacts5Stripped.fp7.zip Edited August 16, 2006 by Guest Add file
LaRetta Posted August 16, 2006 Posted August 16, 2006 1) You have no records in Sales but your relationship between Contacts and the portal goes THROUGH your Sales table. 2) Create a record in Sales for Marinello Thomas and select an Inventory Item. 3) But it STILL will not work. Why? Because you have included the BillToName in the relationship between Sales and Inventory and it should NOT be so. Inventory doesn't NEED to know the BillToName because it can pull that info from the Sales table (actually, it could pull it through Sales table to Contacts). Delete BillToName in this relationship (between Sales and Inventory) so only the ItemNumber binds them. Poof - relationship portal fills. An few observations ... You are using 8 repeating fields to hold Item Name, Selling Quantity and Price. This is not a good structure and I highly suggest you change it now while the design is still new. Also, you are basing your relationships on names - very very bad. Use unique ID serials to hold your relationships together. I see you use StampID so you must understand how key fields work. These two errors in your design will haunt you and cause nothing but problems. Again ... ditch them both and set your relationships properly. LaRetta
tmas73 Posted August 18, 2006 Author Posted August 18, 2006 Thanks for your help as always! I'm really sorry but I dont get it! I was going through all scenarios I could think of, was hoping of a lottery win but like always I lost. I post a new file. Someone please. Contacts5Stripped2.fp7.zip
LaRetta Posted August 18, 2006 Posted August 18, 2006 The issue is this: You have the theory of using IDs REVERSED. Contacts needs to have a ContactID - remove all those other IDs from Contacts. Each table should have it's OWN primary ID. ONE Contact can have MANY Projects. One Project can have many Sales. Memorize this principle: To create a relationship between a ONE to a MANY, you put the ONE-side ID (ContactID) in the MANY-side table (Sales or Projects). When you do this, the ContactID is called the foreign key because it resides in another table (as well as being the Primary key in Contacts). Then join THAT ContactID back to the ONE-side table ID. See FM Help 'Working with the Relationships Graph.' I have no idea how your structure should be - only you know that. You've changed your file completely. And you still are using repeating fields. I can't help you with your structure until YOU understand what you need. Here is a sample file showing how a basic relationship (one-to-many) would work. Again, I highly suggest you ditch the repeating fields here as well. I hope the file is helpful. :wink2: Relationship.zip
tmas73 Posted August 20, 2006 Author Posted August 20, 2006 (edited) So this is the correct way?? Seems to work! Thanks I'm wrong, I need the customer name to be chosen in the other layouts like projects, items... I'm so lost. Relationship.fp7.zip Edited August 20, 2006 by Guest Bigger problem!
Recommended Posts
This topic is 6671 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now