May 6, 200520 yr I have written a script that will validate data that a user enters into a new record. I would like to do the same validation when the user makes changes to an existing record. Is it possible to invoke a script to validate fields on a layout after a user hits enter on an existing record? or is the only way to do this type of validation via the Field rules in the database definitions?
May 19, 200520 yr Author Eventually I found a plug-in that does this ... I have been playing with it to understand it and it appears to do what I want. The plug-in is called EventScript at http://www.softs4humans.com
May 19, 200520 yr I suppose you could add a "Done" Button and force users to hit it when done with a record, then run your script with it.
May 19, 200520 yr Author Sure, but that is an extra step that my users did not want to do. That is why I was looking for an alternative.
May 19, 200520 yr Why not use field level validation? One of the big problems with script validtion is that the data has to be entered into the record before the script processes it; that is, the potentially bad data is in the database, then the user gets prompted to fix it up. What if they cancel the script, exit the program, crash the computer? With field level validation the record is not committed (saved to the database) unless the validation rules are met. The potentially bad data isn't in the database unless it's validated. The more work I do the more paranoid I get about validation, making sure that there is NO WAY that data that breaks the business rules can get into the system. The only sure way to do this is with FileMaker's field level validation; any other method relies on interface to enforce the rules and is easy to break, because it relies on first letting the unchecked data into the system.
May 20, 200520 yr Author I could not find a way to define a field validation rule that covered this situation. The user wants to preload info into the first column of two rows of a portal. But the second row is optional. Because of that I couldn't see a way to define the validation ... the problem is entry of telephone numbers. In the Toronto area we have an area code (905) that can be either long distance or local. The user wants to have a prompt which asks whether the 905 area code is long distance ... and if so, set the country code to 1. I can do that via a script when the data is added, but if the user changes the data later I could not invoke a script. (Does this make sense?)
Create an account or sign in to comment