2 Replies Latest reply on Aug 28, 2014 9:43 AM by beverly

    Re-prioritizing individual records from a returned set

    user311

      I am trying to find the easiest and/or correct way to re-prioritize a set of returned records for a specific day. For instance, we are sorting out a list of records (work orders) with today's date for a view of our daily production board where the records (orders) are assigned to specific employees. The records are listing fine as we currently have it in the example below.

       

      (Employee 1)

      Record1

      Record2

      Record3

      (Employee 2)

      Record1

      Record2

      Record3

      Record4

      (Employee 3)

      Record1

      Record2

       

      We are able to move the records between employees by selecting the assigned employee on the record itself and we have the script re-sorting on data entry but now we want to be able to move those records up and down within an assigned employee's list depending on the changing priorities of the day. For instance, (Employee 1) Record3 moves to the top of their list above Record1 and Record2. We want to be able to create an up and down button that will move those records up and down on the specific employee's list. They are currently listing out in numeric order by the order# field on the record.

       

      I know the information on the sort scripts we are running is vague and we are very new to development but any help down the right path would be greatly appreciated!

        • 1. Re: Re-prioritizing individual records from a returned set
          pmconaway

          A couple of questions come to mind.

           

          1. How are you displaying this currently. form view  with a portal, a layout created as a report, or something else?

          2. I am going to assume that there is sorting built or it could be ordered by record order in the database (no sorting whatsoever)

           

          What you need to do is create another field that holds the sort value that you wish to change. This field doesn't need to be visible to the user. You will need to build this value based on your preferred sort order that you showed in your posting above. Then when someone changes the order then update this sort field to reflect the change. This way you are not changing work order numbers.

           

          Hope this helps.

           

          Paul

          • 2. Re: Re-prioritizing individual records from a returned set
            beverly

            I do this with a script to capture the "sort order number" of the current row to a variable, perform a go to record (next or previous depending on which arrow), capture the new "sort order number" (different number as another variable), replace with the previous number, navigate back (up or down the other direction), replace with the last number.

             

            I create an auto-enter serial # for such "sorting". Because it doesn't care where the numbers occur, they just sort asc (or desc)m correctly. So E1 can have 5, 6, 20; E2 can have 7, 8, 21; etc. They will sort correctly within the Employee. "exchanging" 8 & 21 will make 21 move "up" and 8 move "down".

             

            HTH

            Beverly

             

            p.s. look for samples of dbs who use arrow (keys) and/or drag/drop for re-ordering.