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.

duplicate records

Featured Replies

I have a database that has three fields:

studentID

date

period

When someone creates a new record I need some kind of calculation to do this:

If a person puts in 000001 (studentID) 3/13/02 (date) and 4 (period) I need the calculation to make sure there isn't already a "period 4" on "3/13/02" for that specific "000001" student.

Thanks, Nic

I had to do something similar some time ago, and I can't find the files I did it in, so I'm working from memory here.

Create a calculation text field that concatenates the three fields:

ConcateField = studentID & date & period

This will produce results like this:

"0000017309234"

Make sure the calc field has a text result. Basically the "730923" is the internal representation of the date.

Create a self-join relationship based on this field. I'll call this relationship Self_ConcatField

For each of the three fields validate using a calculation with the following as the calc:

code:


IsEmpty( studentID ) or IsEmpty( date ) or IsEmpty( period )

or

Count( Self_ConcatField::ConcatField ) <= 1

The three IsEmpty functions prevent the validation from failing if any of the fields are empty. The last part makes sure that there is no more than one related field via the relationship.

Again, I did this some time ago, so you may have to tweak the technique.

Chuck

[ March 14, 2002, 01:06 PM: Message edited by: Chuck ]

  • Author

Well, I created "ConcateField" as a text field, with an auto-enter calculation of:

ConcateField = Student ID & Date & Period

But the ConcateField shows only 3/15/2002 and nothing else.

Any ideas?

You may want to check the calculation type is set to text and not a date option in the calculation window.

  • Author

It seems to work.. when someone creates a record that is identical to the other, it now tells them it is a duplicate.. I would like tho for FileMaker to just delete the duplicate record, and perform a File, Close rather than giving them the option to "Revert Field" and change it.

For that you would need a script. Basically the user would enter the information in the record and click a button that says something like "Submit". The submit script would check to see if there were any duplicates (you can use the same field and relationship for the validation technique). If there is a duplicate, then a dialog would come up alerting the user to the fact and then doing whatever you want, such as deleting the new record. Unfortunately you can specify a script to run if validation fails. Perhaps a plugin like oAzium Events could do this. I'm not sure.

Chuck

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

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.