July 11, 200916 yr The below script will only work as expected in the debugger. The found set of 20 records has 5 unique CaseIds and the $caseList variable in the debugger gets populated with all 5. But if I run it outside the debugger then it only has 1 caseID in it. And I do make sure after each run to redo the find. So I am at a loss to why it would work differently in a debugger. I thought that one could iterate and move thru a found sets records with no issues. Go to Layout [ “MERGE_Contract” (FeesRecission) ] // Freeze Window Go to Record/Request/Page [ First ] Sort Records [ Specified Sort Order: Cases::Case_ID; ascending ] [ Restore; No dialog ] Set Variable [ $prevCaseID; Value:-1 ] # Iterate thru found set collecting the CaseIDs for generate loop Loop If [ $prevCaseID not equal Cases::Case_ID ] Set Variable [ $prevCaseID; Value:Cases::Case_ID ] Set Variable [ $caseList; Value:$caseList & ¶ & $prevCaseID ] End If Go to Record/Request/Page [ Next; Exit after last ] End Loop # Iterate thru CaseIDs and call the generate script on each Set Variable [ $listCount; Value:ValueCount ( $caseList ) ] Set Variable [ $i; Value:1 ] Loop Set Variable [ $i; Value:$i + 1 ] Exit Loop If [ $i > $listCount ] # Set the current result item from query into variables Set Variable [ $caseItem; Value:GetValue ( $caseList ; $i) ] Show All Records Freeze Window Enter Find Mode [ ] Set Field [ Cases::Case_ID; $caseItem ] Perform Find [ ] Perform Script [ “TestExport4” ] End Loop Show Custom Dialog [ Title: "im done"; Message: "generated " & $listCount; Buttons: “OK”, “Cancel” ]
July 11, 200916 yr Looks like go to first record is out of place Current: Go to Layout [ “MERGE_Contract” (FeesRecission) ] // Freeze Window Go to Record/Request/Page [ First ] Sort Records [ Specified Sort Order: Cases::Case_ID; ascending ] [ Restore; No dialog ] Should be: Enter Browse Mode Commit Records Go to Layout [ “MERGE_Contract” (FeesRecission) ] // Freeze Window Sort Records [ Specified Sort Order: Cases::Case_ID; ascending ] [ Restore; No dialog ] Go to Record/Request/Page [ First ]
July 11, 200916 yr Author Thank you, Thank you so much! That worked. The completely makes sense and needed some fresh eyes. Won't make this mistake again. However, isn't it odd that it worked when I stepped thru the code in the debugger, thats what thru me.
Create an account or sign in to comment