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.

Unique combination of fields

Featured Replies

I just began with developing in Filemaker and have some questions of which I didn't find an answer (also by using the search function of the forum).

For example, I have 4 tables:

1. Firm-table with FirmID

2. Firm_Heading-table with firmID and HeadingID

3. Heading-table with HeadingID and ThemeID

4. Theme-table with ThemeID

Relations are as follows:

Firm(FirmID) => Firm_Theme(FirmID)

Firm_Theme(HeadingID) => Heading(HeadingID)

Heading(ThemeID) => Theme(ThemeID)

So the table Firm_Theme is a table with 2 ID's (FirmID and HeadingID

The COMBINATION of these 2 values needs to be UNIQUE. One ID can be recorded more than once, because a certain firm can have different headings. BUT a firm can have a certain heading just once.

How do I make the combination unique?

Edited by Guest

Your firm ID needs to be set to be an auto enter serial number and check it so that the user cannot change it. That way each time a new firm record is created a new number will be allocated to the record.

HTH

Phil

  • Author

All my ID's already were "auto-enter seial" and unique.

I added a little screenshot of this part of my database. The most important table is FirmTheme (should be named FirmHeading). The firm needs to choose between several Headings. So if firm 3 chooses heading 2 we get:

firmID = 3

headingID = 2

The headings and firms are unique.

What do I want?

That firm 3 cant choose heading 2 anymore when it already has chosen that heading.

Sorry, quite difficult to explain but the solution has to be very simple. I just want that one firm can choose between various headings, but one heading can only be entered once with a certain firm

stukje.jpg

Sorry but how does a firm 'choose' a heading ?

phil

I think utilization of one of these CF's might do the dwindling job for you:

http://www.filemakerpros.com/FILTER.zip

...or

http://www.briandunning.com/cf/39

--sd

See if this helps.

  • Author

Thanks, you guys are really helpfull. I will try some of your tips tomorrow and let you know if it works.

Thanks

  • Author

In reply to:

I just use a portal where a firm can choose theme's. This data is inserted in the firm_theme (should be named firm_heading) table.

My problem now is: I can choose a heading in the portal. But I can choose it more than once. That isn't what it's supposed to do.

So if firm 2 has heading 3 in the table, it cannot be inserted into the table anymore. (only in combination with another firm)

heading.jpg

firm_theme.jpg

You can choose between validation and a dwindling value list (or both).

The thread I linked to explains how to validate a unique combinations of fields. Using this method, the user CAN choose an existing combination, but it will not pass validation.

A dwindling value list, OTOH, will present only available choices in a drop down list or menu (in your case, only those headings that have not yet been assigned to the current firm). You can find several examples of this method by searching the forums. But it is more difficult to implement - not something I would suggest to a beginner.

  • Author

Ok, thanks, I'll get to it after my break. :

Thanks

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.