Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

Posted

I recently upgraded from FileMaker Pro 7 Developer to FileMaker Pro 11 Advanced.  There are far more changes than I had originally expected, and so I'm carefully going through The Missing Manual book.  I note that the FileMaker Runtime is approx. 100 MB larger than before!   Anyway, I'd like to trap field entry mistakes at the time of the mistake rather than wait until the user clicks off all the fields.  That's when the regular validation occurs.  How can this be done with the new triggers?  For instance, if more than five numerals are entered into a zipcode field, I'd like to trap that immediately (beep) and put the cursor back into the zipcode field.  But that doesn't seem to work; part of the code is on p. 703 of the aforementioned book (essentially an If statement with Length(zipcode) test).  I've tried putting the trigger on OnObjectModify and OnObjectExit--no luck.  I'm sure that someone here has already figured this out.  Or is there a way to change FM so that all the field validations work at the time of tabbing out of the field rather than clicking off all the fields?

Posted

I would use the on modify script trigger on the zip code field...

 

Script....

IF ( Length (ZipCode) > 5)

   Beep

   Go To Field ( ZipCode )

End IF

 

 

if It were ME i would just set the Zip Code field to be a calculation of Left ( Trim ( ZipCode ) ; 5 )

That will prevent the user from entering more than 5 chars in the zipcode field                                                                                                    

Posted

perhaps if you added a commit records step to your script that is triggered onObjectExit?

 

Martie

Posted

KrisM:  That's the script I used, but it doesn't work!

 

MartieH:  Perfect.  I now have a script which commits the record upon exiting the field, and it performs the validation and goes right back to the field if it fails!

This topic is 4275 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.