3 Replies Latest reply on Jan 29, 2009 2:11 AM by fjordseeker

    a script to delete a certain set of fields

    fjordseeker

      Title

      a script to delete a certain set of fields

      Post

      still a newbie -  can someone help me write a little script that i can trigger with a button to clear a certain set of fields? some of the adresses i imported from another DB are incomplete or duplicates. rather than correcting each field or deleting each individually i'd prefer to just hit a button that clears these for me in one go.

       

      many thx 

        • 1. Re: a script to delete a certain set of fields
          TSGal

          fjordseeker:

           

          Thank you for your post.

           

          The script step to replace the contents of a field across a found set is:

           

          Replace Field Contents

           

          There are a few options with this script step...

           

          "Perform without dialog" - allows you to not have a dialog box appear.  Since this is probably going to be automatic, enter a check mark for this option.

           

          "Specify target field" - This option allows you to specify a field.  If you just want the current field that your cursor is active, then leave this option alone.  However, if you want to blank out the "Address" field when this button is pressed, then this option is where you would specify the "Address" field.

           

          The last option allows you to either replace with the current contents, a serial number, or a calculated result.  Since you want to blank out the field, you would select the calculation option and enter "" (that is, quote-quote; a null string).

           

          Therefore, your script step could be:

           

          Replace Field Contents [ No dialog; Address; "" ]

           

          Since you mentioned several fields, you would need a "Replace Field Contents" script step for each field.

           

          If you just want to blank out the information in the current record, then you would use:

           

          Set Field [ Address; "" ]

           

          Once again, if you are blanking out several fields in the current record, you would need a "Set Field" script step for each field.

           

          Once your script is complete, you can attach it to a button.

           

          If you need clarification for any of the above steps, please let me know.

           

          TSGal

          FileMaker, Inc. 

          • 2. Re: a script to delete a certain set of fields
            fjordseeker
              

            thx TS. unfortunately it worked - in the sense that i just wiped all addresses in those fields for ALL RECORDS in my DB. a drag since my backup file had been modified and reimporting only those fields results in mismatched results. looks like i have to start over with the stuff i added since backing up :( 

            how can i make sure this script deletes ONLY the address fields for THIS ONE record?

             

            • 3. Re: a script to delete a certain set of fields
              fjordseeker
                

              hi never mind, the "clear" function does the trick. it clears only those fields i set up in THAT  record.

               

              cheers