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

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

Recommended Posts

  • Newbies
Posted

How do I get the loop, see below, to exit after it has checked the last record? I've tried doing the same thing with Next Record - Exit After Last, but the script exits after only one iteration. It doesn't continue even though I've checked Exit after Last.

Loop

If ["Contact = "N_A""]

Set field ["Contact = "Not Applicable""]

Else

Omit Record

End If

End Loop

Posted

KKelly:

Welcome to the Forums.

The end of your script should be:

End If

Go To Record [next, exit after last]

End Loop

Also, you should put in Go To Record [First] before the beginning of your loop.

-Stanley

  • Newbies
Posted

thanks for the help. however, the script now seems to skip a record whenever Contact does not equal N_A, because it omits, ends the if, then goes to next without checking the one it's on.

Posted

Hi kkelly

[color:red] Update your Profile to reflect the version of FileMaker, OS, and Platform you are using.

Version 6 and 7:

You can also just do a simple Find and Replace to accomplish this.

Put your cursor in the Contact field, and then Go to Main Menu >> Edit >> Find/Replace.

Find:

N_A

Replace

Not Applicable

Direction = [color:blue] All

Search Across = [color:blue] All Records

Search Within = [color:blue] Current field

Or,

Perform a Find in Contact field for "N_A"

Go To Main Menu >> Records >> and Click on Specify and enter this calculation in the Box

Substitute YourTextField; "N_A"; "Not Applicable")

HTH

Lee

Posted

I see it a bit differently ... in reverse actually (typical, huh?). You wish to end up with a set of "Not Applicable" records when finished setting them, right? And that's why you are Omitting? Try this:

Go To Record/Request/Page [ First ]

Go To Field [ anyField ]

View As Form

Freeze Window

Loop

If [ Contact <> "N_A" ]

Omit Record

End If

Set Field [ Contact ; "Not Applicable" ]

Go To Record/Request/Page [ Exit After Last; Next ]

End Loop

It appears to do what you wish and leave you with your proper found set of "Not Applicable." I added the View As Form, Freeze Window and Go To Field[] steps because they substantially speed up looping Set Field scripts in addition to claiming possession in multi-user.

Posted

Wholly cow,

The way the site is acting today, everyone is responding to everyone else, and not the one they are directing their response to.

Lee

Posted

The Go To Record [Next, Exit after last] step should actually be directly after the Set Field step in KKelly's original script. And LaRetta's should have an Else If, followed by the Set Field and GTRN steps, or it omits, sets the next record as "Not Applicable", without testing it, and then continues to the next record.

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