March 20, 201312 yr 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?
March 20, 201312 yr 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
March 20, 201312 yr perhaps if you added a commit records step to your script that is triggered onObjectExit? Martie
March 21, 201312 yr Author 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!
Create an account or sign in to comment