December 23, 200916 yr 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
December 23, 200916 yr 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
December 23, 200916 yr 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:
December 24, 200916 yr Author Thank You Very Much!! I had to step away from the computer yesterday ; ) Have a good Holiday, Kim
December 24, 200916 yr 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