Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Trouble with the concepts here

Featured Replies

I just don't understand why or how portals and relations works. I want to make a simple Client / Product model, where Client is a Table, and Product is a Table.

Client and Product both should have a field called ProductID, The Client::ProductID is linked via a Relationship to the Product::ProductID.

In addition, Products keep track of the the clients that have selected this product. Therefor each Product keeps track of a ClientID, in the same fashion the Clients keep track of the products.

So all I should have to do is this...

1) make the appropriate relations in Define Database (ProductID/ClientID)

2) Create a Portal in the Clients layout that link ProductID

3) Create a Portal in the Product layout that links ClientID

4) create a script to add data to the portal (no clue on this one)

I really think I'm missing a step here, even though this seams simple enough. I'm going to go back and look at the tutorial that came with the program, but any input is appreciated.

I need to figure out how to add data through portals as well, so I can make a script that adds clients or products.

Thanks for the help

You must have three tables:

Client with Client_Id,Client_Name fields

Product with Product_Id,Product_Name fields

Product_Client which joins two files(Client,Product) with Client_Id,Product_Id fields

This relation is "many to many" relation

In the Client Tabel you must create portal to third table on Client_Id field

In the Product table you will create portal to third table on Product_Id field

If you will have questions i can post details

aaa has given you a possible structure (though I would rename Product_Client to be Line_Item, and add an Invoice table between Client and Line_Item, so that a Client could have multiple Invoices, and an Invoice could have multiple Line_Items.)

Usually relationships between tables are one-to-many, where each record on the "one" side links to "many" records on the many side, via the primary ID on the "one" side. So a Client record (with ID 1234) might be related to 3 invoices, if each of those invoices has ClientID 1234.

To build these relationships, you go into File->Define->Database, in the Relationships tab. You will see a Table Occurance (a box) for each table. Simply drag a line from the primary ID of one table occurance to the corresponding ID in another table occurance. So for Client to Invoice, drag a line from the ClientID field in Client to the ClientID field in Invoice. If you make a mistake, you can select a line and delete it, or double click it to change the fields. See attached diagram.

You can view these related records through a portal of Invoices on a layout based on the Client table. Likewise, you can view all the Line_Items or Invoices, where a specific Product is used by having a portal of Line_Items (or Invoices) on a layout based on Product.

To be able to add Line_Items to an Invoice, you can use a portal of Line_Items on a layout based on Invoice, then make sure the option to allow creation of related records is on for that relationship (In File->Define->Database, in the Relationships tab, double click the line between Invoice and Line_Item, and check the option to Allow creation of related records on the Line_Items side.)

I'm afraid there are a lot of details to making a good relational database, and this is only a start. You may want to invest in a FileMaker 7 book or a training class (or both.)

Client-Product.GIF

MrRage: You add data to the related table in the last row of the portal; the key will automatically be written.

  • Author

So the idea of relations is not like a field holds tables, instead an abstraction of tables and fields working together.

Its just a difficult concept for me to grasp, I'm a C++ programmer and FileMaker Pro 7 isn't very intuitive with the background I have. With a little more tinkering around and reading I'm sure I'll get the concepts soon enougn.

FileMaker is much easier than C++. So if you can understand C++, you can understand FileMaker.

A relationship links records in two tables together. Try experimenting with simple examples so you understand what's going on.

  • Author

Alright - going to make a few simple examples and just start playing around with it to get a feel for it. Thanks for the input

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.