AnsweredAssumed Answered

How to open a layout in list view in the same sort order as it was when last viewed?

Question asked by serval on Mar 10, 2016
Latest reply on Mar 12, 2016 by serval

The Scripts Reference manual for Sort Records says,

“When Specify sort order is not selected, FileMaker Pro uses the most recently executed sort instructions.”

I am not experiencing that.

 

While viewing a record in Table A in Form View, I have a script attached to a button to look at a different table, Table B, in List View:

New Window

Go to Layout [“Table B” (Table B) ]

Sort Records [ No dialog ]

The Sort Records command has no order specified.

The resulting Table B list has no apparent order, and it is different order than if I use menu View > Layout > Table B.

 

While viewing Table B from clicking that button, I can sort it differently by clicking on the column headers, which are buttons with attached scripts that use Sort Record with order specified.

Sort Records [ Restore ; No dialog ]

 

I then close the window with Table B, going back to the original view of Table A.

If I then again click the button to open and sort Table B, Table B opens in the same order it did the first time. (That is, no apparent order.)

 

If I specify a sort order in the button script that opens Table B, then Table B always opens in that specified sort order, but I want it to open in the order it was in when I last closed it.

 

Note:

When a sort order is specified with the Sort Records step, it shows in the script as

Sort Records [ Restore ; No dialog ]

When a sort order is not specified with the Sort Records step, it shows in the script as

Sort Records [ No dialog ]

The Scripts Reference manual does not describe the “Restore” option, and appears to automatically linked to the inclusion of a specified sort order.

Outcomes