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.

Sorts in Scripts don't stay sorted

Featured Replies

I have a product database that has about 15 different manufacturers. I need to have each sorted in a different way depending on the manufacturer. So I have created an If script to sort each different (ex: If manufacturer="Jetson's sprockets" and then sort)I get each product line sorted the way that it should, create the script, then test it. Everything is good, BUT when I go back later and try to do this the script either won't work at all, or it doesn't sort the items in the correct sorting order. I have done this for each of the 15 or so manufacturers, but it only messes up on some of them. Is there something that I am doing wrong? confused.gif

Only one Sort[Restore], Import/Export Records[Restore], Print Setup[Restore], Print[Restore], or Find [Restore] can be saved per script. Make each of your sorts into separate scripts and call them, based on the manufacturer, from your main script. Before creating each script, sort your records as desired and each script will permanently hold the particular sort.

  • Author

I have each one as a seperate script and then have a main script that calls the subscripts, that is where the problem is occuring. I was not sure if there is a limited number of subscripts that can be called so maybe it gets half way through and quits?

Have you tested each of the subscripts by themselves? Find a small set of records, run the first sort script. Check whether it's correct by manually (Ctrl/Cmd-S or Records->Sort) sorting and checking the field order in the list. Repeat for each additional script. Or print definitions for all your scripts to PDF and check the sort order from there.

  • Author

Ok, I went through each of the subscripts and tested them individually and they worked fine. It seems to be something that happens when they are all put together.

In the main script I have - Perform Script[subscripts,"Inwalls"] Perform Script[subscripts,"Channel Vision"], on and on 16 more times. I checked and made sure that "Perform sub-scripts" was checked on each.

Could there be a problem with the if statements contradicting themselves? Do I need to have something in the subscript saying that once the if condition has been met, the script needs to stop? I have tried to use the manual and the help menu for help with these scripts, but I have to say that they are not very helpful, so I really appreciate your help

  • Author

I do notice that in the instances where they are not sorted correctly, they are sorted in alphabetical order, so something is telling it to do that. If it matters

The 'Subscripts' option shouldn't matter if you've only one step in each subscript and none of them call other scripts.

It is highly possible that multiple sorts are running. You need to ensure that each If[] is a unique instance. If they aren't, you need to reorganize your structure so that they are logically separate from each other. What is the criteria used to determine which sort to use?

  • Author

ok, I think that I got it fixed. I re-wrote the script so that my If[] were in the main script instead of the sub-scripts. It seems that was where the conflicts were occuring.

Thanks for all of your help cool.gif

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.