4 Replies Latest reply on Jan 5, 2015 10:15 AM by lijnbach

    Sort within a (global) field

    lijnbach

      Title

      Sort within a (global) field

      Post

      Hello everybody,

      I use a checkbox to store the values chosen by the user. It is not complicated and it are just 4 values. (Concrete  -  Computer - Internet - E-book). The user can choose one value, more values or all values, whatever they like, in the pick order they like.

      The chosen values are stored in a global field for later use.

      Later on there is a search (using “Find” - “SetField” - “Perform Find”) based on values in the global field.

      In the SetField is use “from - until”:

      SetField [Location ; GetValue ( gField::MateriaI ; 1 ) & ".."  &  GetValue ( gField::Material ; ValueCount (gField::MateriaI ) )]

      This is working properly only when the “sort order” within the global field is correct.

      Is there a way to sort the values within the global field?

      Thanks in advance,

      Hans Lijnbach.

        • 1. Re: Sort within a (global) field
          SteveMartino

          Just to clarify...you said:

          The user can choose one value, more values or all values, whatever they like, in the pick order they like.

          Then you said

          Is there a way to sort the values within the global field?

          The fields that are checked are creating a list in the order they are checked.  Then what sort order would you like?

          • 2. Re: Sort within a (global) field
            lijnbach

            Thanks for your time and response Steve,

            Well, if I use a SetField with "from - until" the sort order has to be alphabetical, otherwise nothing is find. What i mean is this; if the pick order from the checkbox is e.g. "Internet" and "Computer", the search is based on from "Internet" until "Computer" and that results is no records found. The search should be from "Computer" until "Internet".

            I know that the checked fields are stored in the way the are checked, but for the find I need them alphabetical. 

            Hans Lijnbach

             

            • 3. Re: Sort within a (global) field
              philmodjunk

              Set Field [ Table::GlobalCheckBoxFieldHere ;  FilterValues ( ValueListItems ( Get ( FileName ) ; "ValueListNameHereInQuotes" ; Table::GlobalCheckBoxFieldHere ) ) ]

              Will reorder the selected values in the global field to match the order of the values in the value list. If this is a use values from field value list, the values will automatically be listed in alphabetical ascending order. If this is a custom values value list, you will need to manually order the values in the value list to be in this order.

              • 4. Re: Sort within a (global) field
                lijnbach

                Thanks (again) for your time and effort Phil,

                This works perfectly. (That I didn't think of that. I have been struggling with this issue for hours).

                By the way, I used your solution for checkboxes in Adventure 2.

                Hans Lijnbach.