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.

Assigning relations

Featured Replies

Hello there,

I'm new to relational databases, so any help is greatly appreciated. I think I've gotten my clumsy head round it, but there is one problem that's baffling me.

I have two tables: One is a list of materials, the other a list of vendors. So a many-to-one relationship, right.

It's a database of materials, and where to get them. I would like to enter a new material, and then assign a contact person (the vendor). I think part of the problem is that I start with the 'child' and then assign its 'parent'.

Anyway, I would love to have a nicely formatted drop-down list of names to choose from, ideally followed by the company name. Or even a pop-up window of a list of of the contacts table, with a button that assigns the match key. At the moment all I have is a drop-down list of numbers (the contactID_pk) field.

A nudge in the right direction might be all it needs. I guess I really need a script, no?

The file is attached (Filemaker 8.5)

Many thanks,

Christian

CDatabase.fp7.zip

Is this what you are after?

ValueListContID_NameCalc.jpg

  • Author

Thanks. I think may be getting there. I wasn't so sure about the Value List approach, but I've thought about it some more and I've slightly altered the Value List you picked out. See screenshot. (The calculated field simply does [color:green]Company& ", " & First Name & " " & Last Name

The user can now pick from a list of Companies and Names. However, once he made his pick, he still only sees (the field displays) the contactID_fk value. Not the name. Any idea?

Ideally I still think a pop-up window with a list of contacts to choose from is ideal. But the sample files I could find are simply too complex. Way over my head. Maybe someone knows an example file somewhere...

valuelist.jpg

See attached file. I think this is what you may be after. What I did was superimpose the Contacts::Namecalc field over the ContactsID_fk field. Set the background of the ContactsID_fk to transparent and set the field behavior of Contacts::Namecalc so that you cannot enter it in browse mode. You then click in the field, find all records in the value list that are related to that material and then when you chose the contact only his/her name appears on the layout. I hope this is what you are trying to accomplish.

Al

CDatabase_Copy.zip

  • Author

Very pretty, thank you!

Christian

I predict that you will probably need a many-to-many relationship. Usually, a material is sourced by many vendors. So, you need another table, a "join" table, that has a record for each combination of vendor and material. You could then add to the join table, the cost of the material from that vendor.

Given that, add a portal to the join table on the material layout, so you can see all the vendors, their costs for this material. It'll probably get more complicated. Units per measure/costs vary by #units purchased/etc., but this is a start.

Topic_191001.zip

Edited by Guest

Thanks, but, I can not take the credit. I learned this from others on this forum. Only paying it back.

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.