9 Replies Latest reply on Jan 25, 2013 12:19 PM by nsabel

    Default Value List Value

    laguna92651

      I have a custom value list, that is being displayed as a set of checkboxes. How can I set the default value of all of the checkbox selections as a 1 or checked?

        • 1. Re: Default Value List Value
          opotoc

          Use filed definitions:

          set data to the value you want to have selected by default or use calculated value like:

          List(

          "defaultvalue1";

          "defaulvalue2";

          "defaulvalue3"

          )

           

          PS: You can select all values by default with calculated value: ValueListItems ( Get ( FileName ) ; "YOUR VALUE LIST" ). So if you update your value list, no worries about updating your custom preselection.

          • 2. Re: Default Value List Value
            nsabel

            Set the field to have an auto enter value of all the items you want checked in the form of a CR delimited list.

             

            For example.

             

            A checkbox set with the options RED, YELLOW, BLUE, GREEN and the default value should be RED and BLUE the auto enter data would be.

             

            RED

            BLUE

             

            Both checkboxes will be checked. You could also use a set field in a script or a number of other options.

             

            Nick

            • 3. Re: Default Value List Value
              laguna92651

              Hi Nick and opotoc, thanks for the help but not quite sure what you are suggesting I do.

               

              The field is a text field named AvailSizes, the control style is Checkboxt set and the value list for the checkbox is a custom value list called Sizes2 with values "XS", "S","M", "L","XL".

               

              I tried entering in the Auto-Enter Data section and the Calculate value section:

              List(

              "1";

              "1";

              "1";

              "1";

              "1"

              )

               

              And tried entering in the Auto-Enter Data section and the Calculate value section:

               

              List(

              "XS";

              "S";

              "M";

              "L";

              "XL"

              )

               

              Also tried entering in the Auto-Enter Data section and the Calculate value section:

               

              XS

              S

              M

              L

              XL

               

              I'm sure I'm missing something easy in your instructions.

              Thanks Al

              • 4. Re: Default Value List Value
                comment

                laguna92651 wrote:

                 

                And tried entering in the Auto-Enter Data section and the Calculate value section:

                 

                List(

                "XS";

                "S";

                "M";

                "L";

                "XL"

                )

                 

                That is a correct solution. Once you have that in place, you should see all the listed values checked when you create a new record.

                 

                 

                Another option is to auto-enter a calculated value =

                 

                ValueListItems ( Get (FileName) ; "YourValueListNameHere" )

                 

                This has the advantage of storing the actual values in one place only.

                • 5. Re: Default Value List Value
                  laguna92651

                  Thank you, the ValueListItems ( Get (FileName) ; "Sizes2" ) works. However it only works when I use the New Record button on the toolbar, if I have a script that uses New Record/Request, there is no default value, checked, entered. Is there something else I should add to the script to get the default values entered?

                  • 6. Re: Default Value List Value
                    comment

                    Something is missing from your description. A new record is a new record - I cannot think of a reason why an auto-enter would not take place.

                    • 7. Re: Default Value List Value
                      nsabel

                      Something is missing from your description. A new record is a new record - I cannot think of a reason why an auto-enter would not take place.

                       

                      I have to agree with Michael on this one. I have never encountered this myself and just tried everything I could think of to duplicate the problem. Auto Enter should work the same no matter how the record is created. Do you have something else in the script that changes this field?

                       

                      Nick

                      • 8. Re: Default Value List Value
                        laguna92651

                        All is well, my fault, I had left a Set Field in the script that I had added when I was initially trying to figure out how to set the defaults. Thanks for the help, working great.

                        • 9. Re: Default Value List Value
                          charleshuff

                          What happens in that case? do multiple dots confuse filemaker the way it used to confuse Windows?

                           

                          thanks,

                          Charles