This is the specification for the sort step in my script. Whenever I run the script it always gets to this step and cancels the sort. Does anyone know why?
The set field step is not the cause of this issue, but does nothing in your script as it does not have a calculated result specified.
What happens if you delete the sort records step from this script and then add a new sort records script step to take its place?
Did you select the "perform without dialog" option for this step?
Yes I did, the picture is what happens when I run the script.
That suggests a problem with either the script, your data or your file.
You probably have a set error capture step in your script. Temporarily remove or disable that step and run your script to see what error messages you get. It might be that you are on the wrong layout for your sort at the time that it executes. This will trigger an error, but set error capture could be keeping the error message from displaying.
If not, try creating a new script to sort the records. If it works delete your original script and replace it with new or (better) replace your entire file with a backup copy that doesn't have this problem.
IF that's not the solution, try recovering your file. Test the recovered copy even if it reports no problems found to see if it works. If it does you have two options to try short of keeping this recovered copy: If the recover reported no problems found try recovering the file again but use advanced recovery options to specify only "keep blocks as is" and "Rebuild indexes". This rebuilds all the indexes in your file, and this can effect searches and sorts on your file. If recover reports finding problems, it's best to replace the file with a backup copy.
Things to keep in mind about Recover:
While Recover almost always detects and fully corrects any problems with your file...
And here's a knowledgebase article that you may find useful: What to do when your file is corrupt (KB5421).
I hit cancel sort and let the rest of the script run, and then hit the sort button separate from the script, it sorts correctly. So then I made the sort, the last step in the script, and it still canceled the sort. This means, the file isn't corrupt, because I can still sort it, and i moved around the sorting step in the script and it still kept canceling, so it isn't on the wrong layout during sorting, no?
This is what my script looks like:
Retrieving data ...