Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

Posted

I have attached a file.

The "get rid fo stuff" script does not work like it should..

It seems pretty simple.. If this condition is met delete the record

I have tried finds then delete the info and that does not work in scripting

So I resorted to a LOOP. And still it does not work..

techusedCopy.zip

Posted

You didn't state the exact problem but let me guess; it deletes some of the correct records but misses others.

Here's what I think is happening:

Your script starts, sorts everything, and then goes to the first record. Now lets say that it finds a match on the first test (a null value) so it deletes that record.

Since the record has been deleted, FileMaker automatically advances to the next record because it has to go somewhere and the current record was deleted. You will see that this happens when you manually delete a record; the next record pops up in its place.

Now the script continues where it left off and proceeds with the rest of the loop. Lets say that the new current record matches the first test but does not match the remaining two. Since it is already past the point of the first test you will have to reach the end of the loop and test it on the next pass.

Now here is where your problem is (I think). Just before you hit the end of the loop the script moves to the next record. This means that the record was never tested for condition 1. A record that should have been deleted wasn't because it wasn't tested against your criteria.

Like many things, there is more than one way to skin-this-cat. If this is indeed the problem then I bet you will know how to solve it. If not just post again.

Posted

thanks..

Everytime you think you have seen all the angles, a long comes anew prespective.

I never thought about what would happen if you manually deleted a record.

The answer is not obvious, but please do not tell me. I will enjoy pondering this...

This topic is 7150 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.