August 17, 201015 yr Newbies 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
August 18, 201015 yr 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.
August 18, 201015 yr 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, 201015 yr by Guest
August 18, 201015 yr Author Newbies 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
August 18, 201015 yr 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.
Create an account or sign in to comment