Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

This topic is 5269 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies
Posted

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

Posted

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.

Posted (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 by Guest
  • Newbies
Posted

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

Posted

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.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.