Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Loops and Subscripts

Featured Replies

Morning all -

I have a script that is not looping correctly.

I don't want to have to type it all in - so I will attempt to tell you what it does.

I am finding finance charges on payment plan invoices that need to be posted.

The first part of the script turns error capture on and then preforms a find using set fields. Now if the Find finds nothing I tell it to exit script. That's probably my first mistake - so do I need to create a loop for the find?

After the Find I have it go to the first found record and pull the needed information out of it and then it goes and creates a new invoice for the finance charge. This works find. But this is all in a loop and right before the Next Record step - I have it preforming the sub-script to go and do the invoice (which is in a different database.) If I take the subscript out - the script runs fine and does its Find and marks the records accordingly. But as soon as I add the sub-script step - it just does the first record and then exits the script.

Any ideas? Thanks for the help - I am heading back to bed sick - but will check back later this afternoon.

without knowing what the subscript actually does, it is difficult to give you an answer.

A subscript should not be a problem in a loop.

You don't have a halt script step in there do you?

You don't have to type in the whole script for us, but can you outline it a little more? Especially any statements that have to do with starting and stopping and loops and IF. E.g. is this it so far...

Loop

..Error Capture

..{do Find}

..If {nothing found}

....Exit Script

..End If

.."pull the needed information" ?

-------

Perform Script(External, Invoices)

..New Record

-------

.."marks the records" ?

End Loop

Is it something to do with looping back to the Find after you've marked the records? A good way to troubleshoot this is to insert Pause Script steps all over the place. Then print the scipt(s) out so you can check off each Pause as you go through, and once you've nailed it down, take out the Pauses.

  • Author

Thanks - I will try give more detail tomorrow. My temp is up to 102 and I have the wonderful aches and pains of the flu.

She's got the FileMaker Fever! shocked.gif

  • Author

Hey - thanks - I needed that laugh.

Feeling better today. Still a little achey and dizzy, but at least my temperature is leveling out.

I am going to try a different solution - if it doesn't work - I will get back to you all.

"I have it preforming the sub-script to go and do the invoice (which is in a different database.) If I take the subscript out - the script runs fine and does its Find and marks the records accordingly."

When your subscript has "done the invoice" is it then returned to the original script so that it may continue?

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.