Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 6122 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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

Posted

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

Posted

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?

Posted

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?

Posted

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:

Posted

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 

This topic is 6122 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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