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.

dual key validation

Featured Replies

i have created files for suppliers, products and supplier_products. in the supplier_products file i want to restrict the data to only 1 instance of supplier and product. ie i want to create a combined primary key of the foreign keys supplier_code and product_code.

eg

supplier_a,prod_a

supplier_a,prod_b

supplier_b,prod_a

if the user enters supplier_a,prod_a again i want an error to occurr due to file validation.

if that makes any sense to you i would appreciate your help. smile.gif" border="0

2 very easy way to accomplish this, and 1 caution.

First the caution, do NOT make this the primary key. ALWAYS make your Primary (thus Foreign) keys out of non-user enterable/editable data. I simply use an ID scheme that I detailed in a FAQ at http://www.fmforums.com/ubb/cgi-bin/ultimatebb.cgi?ubb=get_topic&f=8&t=000018

As far as the user is concearned this field can be the primary identifier, but do not make the mistake of believing this yourself.

Ok, now you can validate this many ways, the two easiest are: field validation, requiring that the field be a unique value and giving the user a message that indicates what has happened and how to fix it; the other way is to do your data entry into global fields, then validate that entry with scripting. The second option is more work, but you get alot more control over how to deal with the error.

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.