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

Please Help! search loop to count records based on criteria


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

Recommended Posts

Posted

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

Posted

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

Posted

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:

Posted

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

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