Skip 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.

Failsafe to stop duplicating info?

Featured Replies

For various reasons I have to duplicate some information in my database. I've made a script that takes details from one record and uses them as the basis for a new record elsewhere in the database. My question is: can I add some kind of failsafe to stop me inadvertantly creating a new record with the same information twice?

There are two key fields - 'Date' and 'Supplier' - that I've been trying to use to acheive this. Each of fields does not contain a unique value, but the pairings of these two fields are always unique - for example, there would only ever be one instance of '01/01/2006 and Acme Supplier'. I have been trying to create an 'If' script step along the lines of...

'If ths combination of ''Date and Supplier'' already exists then don't add a new record'

...but I can't figure out the FM language to make it happen. Does anybody have any suggestions?

Add another table occurence of the table, and define a relationship between them:

table <=> table self_join =

table::Date = table self_join::Date

AND table::Supplier = table self_join::Supplier

You can then count the number of records that have the same Date and Supplier by using a Count() function:

Same Date_Supplier Count (calculation, number result) = Count(table self_join::recordID)

If this count is more than 1, then a duplicate exists.

  • Author

Hi Ender. Thanks - I'll try that this afternoon and let you know how it goes.

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

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.