Jump to content
Server Maintenance This Week. ×

Sorting consistency


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

Recommended Posts

If I am working on a found set of sorted records and evoke the Show All Records command, the records always revert to unsorted. But if I am viewing ALL records (and they are sorted) and I Show All Records, they remain sorted. I understand why the found set can't sort when all records are included but I find this inconsistent behavior, ie, why doesn't it change to semi-sorted then?

I think that, any time a Show All Records is initiated, the record set should unsort. At least that's my current stance although I am open to being convinced otherwise. Even a checkbox within the Show All Records script-step which allows (when checked) to Unsort or Remain Sorted would allow the Developer more control. I would bet this inconsistency has bitten a few Developers before.

Link to comment
Share on other sites

Thanks, Lee.

If it is being bypassed then it should throw an error. It doesn't. When I have a script which needs to export all records in their natural sort order of creation (unsorted) then I cannot simply do this:

Show All Records

Export

I must do this:

Show All Records

Unsort

Export

.. or test either for the current sort state, whether found records equals total records or just include an unsort automatically all the time. If it can't Show All Records when all records are shown then it should produce an error at least. My point is that the behavior is inconsistent and unexpected because we are used to see record sets switch to UNSORTED when showing all records manually. :wink2:

TO CLARIFY ... I think you're probably right about it being bypassed and I wondered that myself (and that's why I error tested it). If a step can't run then an error is supposed to be produced ... if nothing else, it could produce 951 'unexpected error.' The fact that it behaves differently depending upon the number of records displayed means scripting must be different depending upon that fact and that is what seems improper to me.

Edited by Guest
Added clarification ...
Link to comment
Share on other sites

You make an interesting point about the Error. I'm not sure it is an error, but it is not expected behavior either. I think that using the Unsort script step is the easiest solution.

Would be nice to see a note in the Debugger when it is skipping a step. At the very least, some kind of explanation in the Help would be nice.

Show All Records

If [ Get ( SortState ) = 1 ]

Unsort Records

End If

As a side note, I've always felt that the Sorted Status could be better. The simple Sorted or Unsorted message below the Rolodex could tell the user more.

Lee

Link to comment
Share on other sites

Yep, I came across this PIB when scripting a full-solution export for recovery and import into a new clean clone from recovered files. It's a totally hands-off process which takes 3 hours to run.

I had (wrongly) assumed Show All Records unsorted because that's what I always saw when I manually showed all records on a found set and it is also what always happened when I scripted a Show All Records and was working with a found set, ie, they always unsorted. But one of the tables was already displaying all records AND was sorted and it exported/imported the records out of their normal 'creation order' and imported them according to the sort.

Bummer. :crazy2:

I think other Developers might be caught by this (I'm strange but not THAT strange). So it would be nice if FileMaker addressed the inconsistency of it.

Link to comment
Share on other sites

This topic is 5713 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.