3 Replies Latest reply on Mar 25, 2013 1:10 PM by philmodjunk

    Best way of showing values from value list

    GuilhermePrudente

      Title

      Best way of showing values from value list

      Post

           Hello again!

           Hope you guys can help me with this one. I have adopted the decision of having "enumeration" tables to feed the value lists. Basically, I have something like:

           EmployeeType ---------------------------------------------<Employee

           -EmployeeTypeID(number)                                             -EmployeeID

           -name(Manager,Salesman,etc.)                                    -fk_EmployeeTypeID(number)

            

           One thing I have been noticing is that, everytime I pull the information from Employee, on a portal or such, EmployeeTypeID comes as a Number. That is perfect as it is set-up that way. However, to display it "accordingly", I always have to go to the fields populated by value lists and set them as pop-up menu with the respective value list so it is displayed correctly. Is this the most efficient/smart way? I'm afraid of forgetting to update a certain field or having too many value lists flying around the place. Would it also be better to consider the "name"/text information itself as the primary key? It's always seems wrong to keep text as a primary key, to me. Let me know your thoughts! Thanks!

        • 1. Re: Best way of showing values from value list
          philmodjunk

               One option to consider is to not to have an EmployeeType table at all. Yes, it often is the best way to go, but sometimes a simple text field in Employee makes better sense.

               I've never used a pop up menu just to show the corresponding "name" as it changes the look of the field in ways that can be undesirable, but see no major reason why it shouldn't work for this purpose. I've always added the needed relationship and just added the name field from the related table. I can use multiple table occurrences of the value table if that is needed.

               Of course, if I need to be able to edit the ID field to select an employee type, I'll use either a pop up menu or drop down list. (I know a way to hide drop down lists behinde the name field.)

               A third option to consider is how large a list of values will appear in your table and how likely the name fields are to be edited after the fact. You can also enforce referential integrity by specifying unique names in the name field (Usually a requirement anyway) and by not permitting the name field to be changed except through a layout set up for the purpose where a script can use replace field contents to update the date fields that use a value list based on this field. That has the added benefit of enabling the use of "auto-complete" on a drop down list to speed data entry.

               This last option is not recommended for value tables with large numbers of records or where a users may be frequently editing a name in the value list, but for tables such as your example here, using the name field directly may be a better alternative.

          • 2. Re: Best way of showing values from value list
            GuilhermePrudente
                 

            I've never used a pop up menu just to show the corresponding "name" as it changes the look of the field in ways that can be undesirable, but see no major reason why it shouldn't work for this purpose.

                  

            How do you usually do it? Using the <<field name>> stuff?

            • 3. Re: Best way of showing values from value list
              philmodjunk

                   As I said in my last post, I add the name field from the value table to my layout. This does require defining a relationship based on the ID number. I usually do not use a merge field for this. I will in most, not all, cases use behavior settings on the name field to prohibit entry into the field while in browse moce.