2 Replies Latest reply on May 19, 2011 10:31 AM by philmodjunk

    Script for checking completing fields.



      Script for checking completing fields.


      Hey Guys,

      I'm still fairly new to FileMaker and scripting but I'm getting better at both. So I'm working a databasee that has a list of about 20 names. To keep the question simple, let's say that the databse has only two fields: one called "names" and the other called "status".

      I want to create a script that will check each name in the "names" field and input yes or no into the status field of the record if the name matches one of about 10 names. I need the script to be able to do this for each of the names. 

      I think I probably will have to write one script for each name. This is fine if that what it takes. Can this be done?

        • 1. Re: Script for checking completing fields.

          There are a number of things you could do

          You could create a table of names that you want to verify then create a relationship between the two names fields

          then you can create a layout for this verification table with a portal showing your other name field and the status box

          You could loop through the verification records checking the value of the related field and updating status if need be.

          The other less usable solution is to loop through your names records and use a case statement to set the status or an If (In List) [dont remenber the syntax]

          This would have the names hardcoded into the script where as the table would allow you to change the  verification set at any time and run the same script.



          • 2. Re: Script for checking completing fields.

            With the relationship linking two tables by name, you can also define a calcuation field that returns either True or False or Yes or No if the name in the current record matches to a name in the related table. (fields with the value 1 or 0 (True or False) can be formatted to display Yes or No.)