2 Replies Latest reply on May 31, 2011 6:23 AM by james.gould

    Maintaining Sort Order

    james.gould

      Title

      Maintaining Sort Order

      Post

      I have some list views with a search box (using Quick Find) and some ascending/descending sort buttons on each field that is displayed in the sort results. What I would like to do is allow the user to find records in this table and then re-sort to maintain the sort order the user had chosen before the Quick Find script is run... I've looked through the both the function and script step reference (and here obviously!) and can't seem to find anything useful...

        • 1. Re: Maintaining Sort Order
          LaRetta_1

          Quick Find isn't scriptable.  In theory, if you are using vs. 11, you could use script triggers.  You would have to store your sort selection in a global variable so that it can be accessed by another script later when User runs Quick Find.  Script would be simple sort just like your current sort scripts.

          In theory, you could then attach script trigger to Layouts > Layout Setup > Script Triggers ...  as OnModeEnter (browse).  In theory, it would work because it works when performing manual or scripted finds.  In reality, Quick Find appears to be a different beast.  The only way it appears to work is if you attach your script to the trigger OnRecordLoad.  But if the record you are on is also in the found set, it will not trigger the sort so I find that method unusable.

          • 2. Re: Maintaining Sort Order
            james.gould

            Hi LaRetta, thanks for your reply... I'm not entirely sure what you mean by "Quick Find isn't scriptable" - I've already got the scripts working using:

            Perform Quick Find [Contact::SEARCH]     (Contact::SEARCH is a global text field)


            Anyway after following your advice (and not sure why I didn't think of it myself!), turns out using Sort Record[No Dialog] (at the end of my quick find script) but not specifying a sort order does the trick perfectly - resorting the records into the order they were last sorted as!