9 Replies Latest reply on Mar 15, 2012 1:04 PM by Malcolm

    Switchable Value Lists

    PeterWindle

      Hello all,

       

      I'm looking for a technique that will change the values in a drop down list, when changing a global preference.

       

      Seems easy enough to do, but I have not quite worked out a way to do it!

       

      I have values stored in two different fields eg:

       

      Field 1 Field 2

      A 1

      B 2

      C 3

      D 4

       

      For my field with the drop down on it, I would like to have a preference on how I want to choose the values, so that when I change the preference, the values in the drop down change.

      The drop down list will be applied to one field, allowing a user to enter the value from whichever is the prefered drop down list.

       

      EG:

       

      My preference options would be A-Z or 1-9

      Choosing Pref A-Z will only display values entered in the Field 1 in my drop down list.

      Choosing Pref 1-9 will only display values entered in the Field 2 in my drop down list.

       

      is this possible? Seems simple, huh? Perhaps I need to rest my brain, it's getting late, can anyone shed some light on this?

      Keep in mind, the Preferece is a global, so if it's used in any calculation field, the index breaks, therefore no more value list.

        • 1. Re: Switchable Value Lists
          comment

          PeterWindle wrote:

           

          Keep in mind, the Preferece is a global, so if it's used in any calculation field, the index breaks, therefore no more value list.

           

          Use records instead of fields.

          • 2. Re: Switchable Value Lists
            PeterWindle

            I hear you, but there are calculations that exist between the 2 fields that the value lists are coming from, therefore, if I change the two fields into records, then I will need to create links between the records within the same table and that's a bit combersome, to say the least.

            • 3. Re: Switchable Value Lists
              comment

              Perhaps you should give as a fuller picture of what this is about.

              • 4. Re: Switchable Value Lists
                PeterWindle

                I have a conversion table, with two fields, one for the imperial value, one for metric. They need to be used togther in calculations, in order to convert values throughout the system. 

                 

                I'd like to have a preference to switch between what the measurement value entered is supposed to represent.

                 

                When values are inputted, they should be entered as either metric values, or imperial values. I'd like to drop down list to change, according to a preference.

                 

                 

                eg:

                 

                Value is 3, Measurement is grams

                 

                I would like grams to appear in a drop down list of available metric measurements, if metric is the chosen preference.

                 

                Value is 3, Measurement is ounces

                I would like ounces to appear in a drop down list of available imperial measurements, if imperial is the chosen preference.

                 

                keeping in mind, the values in the drop down lists will be coming from the conversion table, which contains the two fields metric an the corresponding imperial values

                 

                I suppose I could separate the fields into records or even create two tables, one for imperial one for metric, but again, that seems like a lot of overhead for a small value list to be displayed.

                • 5. Re: Switchable Value Lists
                  RonSmithMD

                  Hi, Peter.

                   

                  I hear you and think I understand what you are trying to achieve. I have developed and will shortly be implementing variable value lists for my PaperCutPro solution to allow for different sets of value lists depending on whether the History and Physical is for Pediatrics, Family Practice, OB/Gyn, etc. It is essentially a type of template.

                   

                  I plan to publish this as a detailed article in my personal document section in the next week or so. You will be able to see it by searching for documents with the tag ronsmithmd so it should be easy to find.

                   

                  Warmest regards,

                   

                  Ron

                   

                  Ron Smith, MD

                  ron@ronsmithmd.com

                  • 6. Re: Switchable Value Lists
                    comment

                    PeterWindle wrote:

                     

                    Value is 3, Measurement is ounces

                    I would like ounces to appear in a drop down list of available imperial measurements, if imperial is the chosen preference.

                     

                    keeping in mind, the values in the drop down lists will be coming from the conversion table

                     

                    That's not going to work, as you have already discovered. Since these values are not likely to be changed, why don't you simply define two custom value lists?

                    • 7. Re: Switchable Value Lists
                      Malcolm

                      When values are inputted, they should be entered as either metric values, or imperial values. I'd like to drop down list to change, according to a preference.

                       

                      Then you need two more fields in your value list table

                       

                      1. a number field "fl_default"

                      2. a calc field     if( fl_default ; metric ; imperial )

                       

                      Whenever the user sets the preference they click an "apply" button which sets the field fl_default to 1 or to 0 in all the records.

                       

                      malcolm

                      • 8. Re: Switchable Value Lists
                        comment

                        Malcolm wrote:

                         

                        Whenever the user sets the preference they click an "apply" button which sets the field fl_default to 1 or to 0 in all the records.

                         

                        That would be "user" in singular form, right?