Philby Posted June 3, 2005 Posted June 3, 2005 Hello, I wish to validate entered data so that a value entered has not been entered before. I am using a data entry layout which just has global fields, when the user clicks on a "create" button a record is created and the data is tranferred from the global fields into the record. One of the fields is a serial number. They are not entering the number sequentially, so I can't have filemaker automatically put in a number. What I want to do is check when the number is entered to see if it matches any value that has already been entered. I see a validation of "member of value list", is there an equivalent "not member of value list". Or, is there a function that I can use to check if the entered value matches any value in another field? Thank you,
-Queue- Posted June 3, 2005 Posted June 3, 2005 There is a 'unique' validation option that you could use. However, I would strongly suggest you do not make the serial a user-entered value. Have FileMaker create its own serial number, which you use for relationships. No one ever need see the true serial. Then it will not matter what 'serial' number users enter, since it will only be used for visual purposes.
comment Posted June 3, 2005 Posted June 3, 2005 Not sure what is your question. If you're using field Validation Options, you have the choice of 'Unique value'. But if you're entering data into globals first, you probably want to do the test yourself. One option is to create a value list of all existing serial numbers, and check if the global number is a member, e.g. Position ( ValueListItems ( Get ( fileName) ; "yourvalueList" ) ; gSerial ; 1 ; 1 ) Another way is to create a relationship based on gSerial = Serial, and check if there is a related record, e.g.: IsEmpty ( relationship::Serial) In both cases, the test is reversed simply by preceding it with "not": If [ not Position ( ValueListItems ( Get ( fileName) ; "yourvalueList" ) ; gSerial ; 1 ; 1 ) ] New Record/Request Set Field [...] ... Else Beep Show Custom Dialog End If
Recommended Posts
This topic is 7449 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 accountSign in
Already have an account? Sign in here.
Sign In Now