9 Replies Latest reply on Sep 19, 2016 2:37 PM by greatgrey

    User Choose-able custom sort order

    manager12

      Hello,

       

      I'm making a contact sheet that lists Peoples Names (and address, phone, email and title in line with their names) under the name of the department they work in.

      Example:

       

      ACCOUNTING:

      Joe Smith     Address      Phone    Email

      Head Accountant

       

      Sally Voigt    Address      Phone    Email

      Assistant to the Accountant

       

      I need to create a way so the user of the database can choose the order in which the names appear under the department header. It won't be alphabetical by name or even title. The user should be able to make any person in the accounting department appear in any order they want, as easily as possible. In the past I have done this by assigning each person a number and the user could change the number of the person in the department and it would sort based upon the number they were assigned. But this is messy and difficult for the user. Any suggestion on how to do this in an easy and streamlined way for the user? Often the user will want to put a persons assistant under directly under that persons name.

      Thank you!

        • 1. Re: User Choose-able custom sort order
          beverly

          This thread appears to be the same as your question. I advise that you checkout the demo by Dr Cologon.

           

          Here are other article/video

           

          and more. I just searched for 'filemaker drag drop sorting'. Try first link first.

           

          beverly

          • 2. Re: User Choose-able custom sort order
            philmodjunk

            As an alternative to drag and drop, you could also set up an interface where the user can click buttons in the order desired for the sort and an associated script could update your number based "sort order" field to create the desired order. This is almost as "user friendly" as drag and drop, but perhaps simpler to implement.

            • 3. Re: User Choose-able custom sort order
              David Moyer

              Hi,

              Do you need a different sort order for each user?  That would complicate things.

              If these contact sheets aren't too long, you can display them in a portal and include a button (on each row) that would fire a script to rearrange the rows.

              • 4. Re: User Choose-able custom sort order
                manager12

                Thanks all for your responses! I see the drag and drop method requires the use of portals. The current contact sheet I have is set up as a report layout (it needs to be e printable).  Is there a way to do the drag and drop method without portals? For instance dragging the records around in the report layout?

                thanks!

                • 5. Re: User Choose-able custom sort order
                  philmodjunk

                  Why would the existing report layout preclude the use of a portal? Create a new layout with that portal and use it for setting up the sort order and leave your report layout unchanged.

                  • 6. Re: User Choose-able custom sort order
                    keywords

                    Re: "In the past I have done this by assigning each person a number and the user could change the number of the person in the department and it would sort based upon the number they were assigned. But this is messy and difficult for the user."

                     

                    I can't quite see what is messy and difficult about this approach. It is as easy as entering/altering a number in a single field. I use that method to order, for example, a priority list of phone numbers. It is only necessary to enter a 1 against one of them to bring it to the top of the list; there rest will then be listed in default order (usually this means creation order) unless you further sort by other numbers.

                    • 7. Re: User Choose-able custom sort order
                      beverly

                      I have used a method (with buttons) that "swap" any two records or portal rows. that swap the sortOrder numbers. Not as cool as drag and drop, but it works and they don't have to type anything. Something can be repeatedly moved, but if it's last in a 100 record list, moving one-by-one is not as elegant as just changing the numbers, as keywords points out.

                      beverly

                      • 8. Re: User Choose-able custom sort order
                        manager12

                        Ok so I've started to implement the move up and move down buttons on my report layout. I have a field called SortNum that holds the sort number and then when you press the move up button it runs a script that subtracts 1.5 from the current sort number and then re-sorts the list. It seems to be working however I'm not sure how to get this next part working. Each Person is assigned a department and so when the original report script runs on layout entry it sorts everyone under a department header. When I click the move up button it moves them up, which is great. However if I leave the layout and then re-enter it, its going to run the original script that sorts everyone by department (and there by losing the custom sort order I already set using the move up button). I think I can get around this by altering the original scrip to sort by department and THEN SortNum on layout entry.

                         

                        I'm making this Contact Sheet report layout for a Client who has already entered most of the data in the the database. There are over 150 people in the contact sheet. For any additional people added I can have a serial number automatically entered into the SortNum field when a new person record is created, but for all the existing people, is there an easy way I can assign them a number to their SortNum field without having to do it manually? And how would I do this so it keeps everyone in the right department? Does that make sense?

                        Thanks all for your help!

                        • 9. Re: User Choose-able custom sort order
                          greatgrey

                          The Replace with serial number option or calculation will work nicely, just make make sure nobody else is using the file when you do it.