July 3, 200619 yr Newbies I have created a relational data base. I am trying to create a script that will delete all the the related records from Table B when I delete a recorded from Table A. I tried to do a find, but it appears that the criteria in “Perform Find” only allows you to hard code an entry. For example, you can use this as the criteria “=2.1” but you cannot use “=$temp“ where $temp is equal to 2.1. Is it the case that I can’t use a variable in the find criteria? How can I do such a find? I admit I am new to FileMaker Pro, so if this is a simple mistake, great. I find it hard to believe you can’t find programically using variables of field data.
July 3, 200619 yr Boberino, First welcome to the forums. The easiest way to delete related records is via the relationship. One of the checkboxes in the relationship dialog box is "Delete related records in this table when a record is deleted in the other table." No scripts are necessary. HTH, Mike
July 3, 200619 yr Author Newbies *******! That worked! I have spent a couple of hours trying to figure out how to do it! Thanks! I’m glad I found this site! I have programmed c, c++, etc, in the past but have always shied away from FileMaker because of its non-standard scripting. (I’m used to just typing in what I want). I have been working with it for two days now (FileMaker Pro Advanced 8.03) and find it pretty good. I just need to get past the learning curve. Thanks again.
July 3, 200619 yr How can I do such a find? Hi Boberino, Yes, you can use variables in finds. It would look something like: Set Variable [ $numField ; Value: numField ] Enter Find Mode [ ] Set Field [ numField ; $numField ] Perform Find [ ] However, to quickly isolate a found set of related records, it is easier to use Go To Related Record [ Show only Related Records]. For deleting, using the relationship as Mike suggested is quickest but I wanted to help speed your learning curve and you had asked the questions. With FileMaker, there are many roads to Rome and roads to roam. :wink2:
Create an account or sign in to comment