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

Please Help! search loop to count records based on criteria

Featured Replies

Help me!!!! I am ready to jump off a bridge on something very basic, at least it should be....

I want to get a count records based on two tear criteria, my scipt works great but when I do a find and there is nothing to find, it pops me out of my script loop.

How do I ignore the find error of "no records match this set of Find Requests"

Two data bases related by school, storing count in the "school" table and counting the SE._Case_.....

Here is my script:

Go to Layout [ “School Data” (schools) ]

Go to Record/Request/Page

[ First ]

Loop

Copy [ schools::schoolName ]

[ Select ]

Go to Layout [ “Student Information Entry Page ” (S.E._Case_Distribution) ]

Enter Find Mode [ ]

Paste [ S.E._Case_Distribution::School of Attendance ]

[ Select ]

Set Field [ S.E._Case_Distribution::program code; "SL - 05" ]

Perform Find [ ]

Copy [ S.E._Case_Distribution::countAllRecordsShown ]

[ Select ]

Go to Layout [ “School Data” (schools) ]

Paste [ schools::totalSLPAsPrimaryDisability ]

[ Select ]

Go to Record/Request/Page

[ Next; Exit after last ]

End Loop

Immediately after the Perform Find, do either:

- if( get(lasterror) = 0

or

- if( get(foundcount) > 0 )

As an aside,

Don't use copy and paste to set fields in find mode! Instead set a variable or a global field

I believe it will also be important that, right before the Perform Find[], you use the script step:

Set Error Capture [ On ]

This will suppress the error message and allow you to handle the error yourself as Wim is suggesting. :smile2:

  • Author

Thank You Very Much!! I had to step away from the computer yesterday ; )

Have a good Holiday,

Kim

Copy/paste is something you should avoid using in scripts; use variables and set field instead.

Go to Layout [ “School Data” (schools) ]

Go to Record/Request/Page [ First ]

Loop

Set variable { $school ; schools::schoolName ]

Go to Layout [ “Student Information Entry Page ” (S.E._Case_Distribution) ]

Enter Find Mode [ ]

Set field [ S.E._Case_Distribution::School of Attendance; $school ]

Set Field [ S.E._Case_Distribution::program code; "SL - 05" ]

Perform Find [ ]

Set varable { $fc ; get( foundCount ) ]

Go to Layout [ “School Data” (schools) ]

Set field [ schools::totalSLPAsPrimaryDisability ; $fc ]

Go to Record/Request/Page

[ Next; Exit after last ]

End Loop

Create an account or sign in to comment

Important Information

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

Account

Navigation

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.