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.

Odd one - loop thru found set works in debugger only

Featured Replies

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” ]

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 ]

  • 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

Important Information

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

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.