Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

This topic is 5814 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

What's the best way to implement a unique dual key index (SQL terms) in FMPro?

For example, a company_contact table: with 2 key fields: CompanyID and ContactID

CompanyID ContactID

-------------------

COMP-001 CONT-001

COMP-001 CONT-002

COMP-001 CONT-002 not allowed (duuplicate)

COMP-002 CONT-001

COMP-002 CONT-004

COMP-003 CONT-005

COMP-004 CONT-002

etc.

- Jansen

  • Newbies
Posted

Create a new field of type text. This field will serve as the unique key.

Add a field calculation of something like CompanyID & "|" & ContactID.

Uncheck the "Do not replace existing value for field" option.

Check the "Prohibit modification of value during date entry" option.

Check the "Not Empty" and "Unique Value" validation options.

Posted

RobertTaylor66,

One of us must be mixed up.

How do you access the following options you mentioned for a "Calculation" type field?

1. "Do not replace existing value for field"

2. "Prohibit modification of value during date entry"

3. "Not Empty"

4. "Unique Value"

  • Newbies
Posted

Please re-read my post.

You do NOT want a calculation field.

You want a Text field with a calculation (defined on the Auto-Enter tab of the field options dialog).

The goal is to create a third field that will automatically be the concatenation of the two other fields. This third field will will enforce the uniqueness for your design.

This topic is 5814 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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