Jump to content

I thought this would be simple.


This topic is 6532 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • 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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • 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.

Link to comment
Share on other sites

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:

Link to comment
Share on other sites

This topic is 6532 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.