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.

Display a loop counter?

Featured Replies

I sometimes need to loop through thousands of records and perform lengthy calcs on each record, so this operation can take hours or even days to complete. I use freeze window so as to not slow down the operation, but is there a way to display a continuous loop counter or progress bar?

1 hour ago, human said:

is there a way to display a continuous loop counter or progress bar?

I don't think so. What you could do, though, is pause the script every N records for a fraction of a second. This will refresh the window and update the layout object displaying a counter/progress bar.

You may also want to look into streamlining your calculations. 

 

Additional things which can help:

1. Be on form view instead of list or table view

2. Run the script via PSOS (Perform Script on Server)

3. Switch to a Utility layout with no fields

I suspect that you are using unstored calculations or even worse - calculations which are based upon other calculations which are based upon even other calculations.  Even with highly-complex structure and complex calculations, it shouldn't take days.  It might be worth allowing a professional Developer to review your file to identify the bottlenecks. 

I hope you figure it out - that would be quite frustrating!

  • Author

The main concern is that I haven't messed up the code so as to create an infinite loop. I do run the scripts server-side, normally, and that creates the additional challenge of getting some kind of feedback. The best I have figured out is to send myself emails on errors, or every thousand or few thousand or so steps, so I can see how it progresses.

5 hours ago, human said:

The best I have figured out is to send myself emails on errors, or every thousand or few thousand or so steps,

Maybe you should consider a different strategy:
Divide your records into groups of say one thousand records each. For each group, perform a separate script on the server and get the feedback through the Get(ScriptResult) and Get(LastError) functions.

 

  • Author
16 minutes ago, comment said:

Maybe you should consider a different strategy:
Divide your records into groups of say one thousand records each. For each group, perform a separate script on the server and get the feedback through the Get(ScriptResult) and Get(LastError) functions.

 

That could work, thanks

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.