April 8, 200223 yr I am trying to validate the uniqueness of 2 fields entered into a client database. For example the 2 fields are First Name and Surname. The next time I create a new record I want the database to use the validation option to check if the combination of these 2 fields is unique and give a warning. I don
April 8, 200223 yr You really want to validate a calculation field (=firstname & surname) but FMP does not natively do this. However there is a TechInfo article describing such a technique. Go to the TechInfo database on the FileMaker Inc web site (probably under support) and search for "validating a calculation field" or something similar.
April 8, 200223 yr quote: Originally posted by Vaughan: You really want to validate a calculation field (=firstname & surname) but FMP does not natively do this. However there is a TechInfo article describing such a technique. Go to the TechInfo database on the FileMaker Inc web site (probably under support) and search for "validating a calculation field" or something similar. I didn't check if such article exists but here's what I've done: Create an calc field with result text: code: unique=name & Length(name)&surname & Length(surname) make it indexed and check the option "Do not evaluate if all referenced fields are empty" and make sure that you've selected "not empty" the validation for name and surname. Than make an self-relation Validator::unique->unique. Define field "status" as text and autoenter look-up from field unique from self relation Validator with option "don't copy if no match" checked. Create validation by calculation for this field as: status!= unique and uncheck option "validate only if field has been modified" In the validation panel check strict and custom message Now. put those fields on your layout. Put the field status behind name or surname and uncheck " allow field entry" and make the the text color same as background(or make the background color of overlaying field to some color). Ommit status field from tab order for this layout: you have to have fisically field "status" on your layout or yoy'll end up with an non overriding message from FM. HTH Dj [ April 08, 2002, 04:55 AM: Message edited by: dj ]
April 8, 200223 yr I've just checked FM site and yes there are few TECHINFO on this topic. Here's one that more or less I've implemented validate calc field Dj [ April 08, 2002, 05:05 AM: Message edited by: dj ]
April 8, 200223 yr Author Thank you very much for your help, I looked up the Tech info CD and there it was.
Create an account or sign in to comment