6 Replies Latest reply on Oct 30, 2015 12:21 PM by BrentJohnson

    Adding "Not Listed" to a value list

    BrentJohnson

      I am wanting to add "Not Listed" to the bottom of a value list.  So if the drop-down list does not contain a specific city, by clicking on "Not Listed" this will allow the user to enter the city name.

      The value list is based on a field from the _City table.

        • 1. Re: Adding "Not Listed" to a value list
          jbrown

          Hi.

          The only way I've solved this is by putting a check box under the field that is labeled "Not Listed". This would blank out the City field and/or put "not Listed" in that field (which can happen even though that value is not on the value list).

          • 2. Re: Adding "Not Listed" to a value list
            TomHays

            What you describe is something that might be needed for pop-up menus, but drop-down lists already handle this natively by having the user click twice in the field without the need for a specific menu selection.

             

            If you really do want that behavior, I would use a script trigger to capture the behavior when the user selects the "Not Listed" choice.

             

            -Tom

            • 3. Re: Adding "Not Listed" to a value list
              jbrown

              I forgot a part.

              After clicking the check box for "not listed", I'd hide the dropdown / popup and show them the same field that is set to the Edit Control so tthey can type it in. As far as workflow, they simply check the "not listed' box. and then they type in something.

               

              Using the same "City" field, twice, one as a dropdown or popup, and the other as the edit (normal) field, the user still gets the data in and gets a chance to type in the name.

              • 4. Re: Adding "Not Listed" to a value list
                TomHays

                To follow up on how a script trigger would achieve what you want...

                (and somewhat an elaboration on what Jeremy wrote)

                 

                You need two additional things beyond your original drop-down list: a copy of your data entry field on the layout and a script.

                 

                (1) Make a copy of the drop-down list City field and format it as an Edit box.  Give this new layout object a name such as "OtherCityEditBox".  This is a name that you can use in the Go to Object[] script step.  (Adjust the Tab order for things on the layout to suit your needs.  You might remove both from the tab order to avoid confusing behavior.)

                 

                (2) Position this new field underneath the drop-down list field so that it is completely hidden.  (User clicks will always hit the drop-down list on top of it.)

                 

                (3) Write  script to use as a script trigger on the drop-down list field.  Something like this:

                If [Contact::City = "Not Listed"]

                  Set Field [Contact::City; ""]

                  Go to Object [Object Name: "OtherCityEditBox"]

                End If

                 

                (4) Attach this script as an On Modify field trigger to the drop-down list.

                 

                -Tom

                • 5. Re: Adding "Not Listed" to a value list
                  TomHays

                  If you are asking how to add "Not Listed" to your drop-down menu which is automatically generated by entries in your _City table, you have two choices.

                   

                  (1) Add a new record in your _City table with the City name of "Not Listed".

                   

                  or

                   

                  (2) Create a new calculated field in your _City table that is defined as:

                  List(City; "Not Listed")

                  Change your value list to use this calculated field instead.

                   

                  Making the value appear at the bottom of the list requires you to use something other than the string "Not Listed".  The simplest may be to use "{Not Listed}" so that the curly brace is sorted after all city names.  Change the calculated field (or the City field if you are using the first method) to have its Default language setting to be "Unicode".

                   

                  You can also add an invisible character to the start of "Not Listed".  For example in method (2) you can use

                  List( City;

                  Char(65279) & "Not Listed"

                  )

                   

                  This character won't show up in the menu but will affect the sort order for the entry so that it appears at the end of the list.

                   

                  Note that if you use some string other than the simple "Not Listed", you need to reuse this string in your triggered script when checking which menu item was selected.

                   

                  -Tom

                  • 6. Re: Adding "Not Listed" to a value list
                    BrentJohnson

                    Tom & Jeremy,

                    Thank you both so much for your help and advise.

                    Tom your last suggestion worked perfectly!!!

                     

                    Again, thank you both!!!