From Dwayne Wright PMP, PMI-ACP, CSM
Certified FileMaker Developer
Nothing ground breaking here but I wanted to share how a looping script, set error capture and validation have to be tweaked properly to work in concert correctly.
I just imported 1,200 + questions that I used in a crossword related quiz product I was producing. These questions will need to be edited because they have only one answer, the one you put into the crossword. A quiz record needs to have multiple possible answers and then an indicator of which one is the correct answer. So when I imported the data, I imported the correct answer for all the records into the answer A field. So I had over 1,200 questions that all had the answer A as the correct choice.
I wrote a script to help with this cleanup process. Basically, I wanted to shuffle the answer from the crossword into either answer A, answer B, answer C or answer D position. The table does have validation set up for me to enter in the difficulty level of the question. The current version of the quiz doesn’t have a difficulty selection option but will in the next release. In fact, it might already be there by the time you read this.
I also had turned on the Set Error Capture and I really don’t know why. Anyway, because of the validation in the table and the Set Error Capture On setting, if I didn’t commit the record before the Go To Next Record command, it simply didn’t go to that record. I had placed the Commit Record step on each step except for when I passed over the first answer A option.
When my script was done the first time, everything looked great. Quickly I realized I had zero answer A options because my Go To Next Record wasn’t firing due to the validation / Set Error Capture combination settings. The quick addition of the Commit Records step in the pass over for answer A fixed the problem.
More info about the author and FileMaker in general, contact me at firstname.lastname@example.org.
© 2009 - Dwayne Wright - dwaynewright.com
The material on this document is offered AS IS. There is NO REPRESENTATION OR WARRANTY, expressed or implied, nor does any other contributor to this document. WARRANTIES OF MERCHANT ABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY DISCLAIMED. Consequential and incidental damages are expressly excluded. FileMaker Pro is the registered trademark of FileMaker Inc.