Skip 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.

Script slowdown

Featured Replies

I have a simple script the shows a custom dialog that gives the user the choice of running one of two scripts. When I run either of these two scripts via this dialog they run very slowly. If I run them without going through this custom dialog they run almost instantaneously. I can't figure out what the problem is as I am making this work the same way I have for other scripts without any problems.

Any ideas?

Greg

  • Author

Ok, I did some more testing and I found that the problem is really running the scripts via a button verses running them from the script menu or script manager.

If I run it from a button it takes forever but if I run it from the menu it is fast.

Could this be a bug?

Greg

Is the button for sure running the same script? If so, is it passing in a parameter that does something different? Have you run it using the debugger to see what's going on?

  • Author

Thanks for the reply Fitch. Yes the button is running the proper script and there are no additional parameters being used. I did run it with the debugger both ways and there was nothing I could learn from that. Both ways are the same in every way except the time it take to complete. It's very bizarre.

Are there any known bugs relating to running scripts via buttons or using custom dialogs?

Nope, no bugs associated with this type of functionality.

If it's not script parameter, then it might be context at the moment of script fire. What is the name of the table and table occurrence where the button resides? You can determine that by going to Layouts > Layout Setup and see what it says under 'Show Records from'. Then determine the table and table occurrence of where you are when you fire the script from ScriptMaker. Different by any chance?

If not, we'll probably need to see your file or at least the script itself. It is usually the little things that can trip us up.

LaRetta :wink2:

  • Author

I checked and the scripts are both activated and running on the same table.

Here are the scripts.

The selection script:

Allow User Abort [ Off ] 

Set Error Capture [ On ] 

Show Custom Dialog [ Title: "Convert Measurements To Imperial"; Message: "Convert all records in the found set or just the current 

record to Imperial?"; Buttons: “All”, “Current”, “Cancel” ] 

If [ Get ( LastMessageChoice ) = 1 ] 

Perform Script [ “Convert All to Imperial” ] 

End If 

If [ Get ( LastMessageChoice ) = 2 ] 

Perform Script [ “Convert Current to Imperial” ] 

End If 

If [ Get ( LastMessageChoice ) = 3 ] 

Halt Script 

End If 





One of the two script choices:


Allow User Abort [ Off ] 

Set Error Capture [ On ] 

Go to Record/Request/Page 

[ First ] 

Loop 

If [ Inventory::Measurement System = "Imperial (lbs / in)" ] 

Show Custom Dialog [ Title: "Error!"; Message: "A record that is already in the Imperial format has been found!"  Perform a 

find and omit records with Imperial data and then run the function again."; Buttons: “OK” ] 

Halt Script 

End If 

Set Field [ Inventory::Length; Inventory::Length / "25.4" ] 

Set Field [ Inventory::Width; Inventory::Width / "25.4" ] 

Set Field [ Inventory::Height; Inventory::Height / "25.4" ] 

Set Field [ Inventory::Weight; Inventory::Weight * "2.2046" ] 

Set Field [ Inventory::Measurement System; "Imperial (lbs / in)" ] 

Go to Record/Request/Page 

[ Next; Exit after last ] 

End Loop 

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

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.