Newbies vitorc Posted August 17, 2010 Newbies Posted August 17, 2010 I wonder if there is any way to use the value set in the "Maximum number of characters" (in the menu Field> Validation) in a script. I have not found any function that returns this value. Thanks, Vitor Cedran
Vaughan Posted August 18, 2010 Posted August 18, 2010 The way you could do it is store the max length in a field in a prefs table and reference it in a validation calculation.
LaRetta Posted August 18, 2010 Posted August 18, 2010 (edited) Check out Length() Length ( yourField ) :less: num where num is the number of characters. "(in the menu Field> Validation) in a script." Not making sense as Daniele suggested. Do you want this at field-level validation, script trigger (upon validate) or in script? If field definitions validation, validation will pass if it is true (produces boolean 1) so if max length should be 10 then validation would be: Length ( Self ) :less: 10 Edited August 18, 2010 by Guest
Newbies vitorc Posted August 18, 2010 Author Newbies Posted August 18, 2010 Check out Length() Length ( yourField ) :less: num where num is the number of characters. "(in the menu Field> Validation) in a script." Not making sense as Daniele suggested. Do you want this at field-level validation, script trigger (upon validate) or in script? If field definitions validation, validation will pass if it is true (produces boolean 1) so if max length should be 10 then validation would be: Length ( Self ) :less: 10 Thanks for the help ! But I want to use the value of maxlenght (the same value shown in "Maximum number of characters") to make a validation in script. I'll compare this value with the lenght of the field to make a custom validation. I wonder if there is any function that returns this value. Thanks, Vitor Cedran
Raybaudi Posted August 18, 2010 Posted August 18, 2010 I thought of that, but there's no need to know wich is the max-lenght because FileMaker just knows it and will return error 511 ( Value in field exceeds maximum number of allowed characters ) if you try to enter a number of chars > of max-lenght. All you need to do is check the "Always" radio button on the validation option for that field.
Recommended Posts
This topic is 5269 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