4 Replies Latest reply on Mar 14, 2013 9:24 AM by vlight

    Having a field enterable based only on another field's value

    vlight

      Title

      Having a field enterable based only on another field's value

      Post

           In FM11, I have a field to track the source of my contact. Multiple sources are possible, so I've set up that field on the layout to use checkboxes with a drop-down list, showing values from a "Sources" value list.  One of the choices is "Recommended."  An additional text field "Recommended By" is available for the user to enter a person's name.  

           1st scenario -- I do not want that text field enterable unless the Source field first has a checkmark selecting "Recommended."  

           Or, a 2nd scenario would be fine -- if a person DOES enter it and types in a person's name, then i would want to be sure that the "Recommended" choice is selected FOR them, if they haven't done it already.    (I tried this route via an auto-entered calc on the Source field, but had to de-select the "Do not replace existing value..." for the Recommended choice to get selected, but unfortunately it also deleted (un-checked) any other Source choices that were already checked!  maybe my calculation was just wrong, or maybe this isn't the route to use.)

           Any suggestions for accomplishing either scenario?

        • 1. Re: Having a field enterable based only on another field's value
          philmodjunk

               I like the 2nd scenario:

               Use this auto-enter calculation with the "Do not replace..." check box cleared:

               If ( IsEmpty ( FilterValues ( Self ; "Recommended" ) and Not Isempty ( Recommended By ) ; List ( Self : "Recommended" ) ; self )

               How it works:

               When you click check boxes in a group of the same, each clicked check box adds a value to the field separated from other selected  values by a return character. List ( "value1" ; "value2" ) produces the same return separated list of values and List ( Self ; "recommended" ) appends "reccommended" to the end of any list of such values already present in the field.

          • 2. Re: Having a field enterable based only on another field's value
            vlight

                 almost there...but not yet...  I entered the calc you gave me (thanks!),  and only needed to make two changes (otherwise, I couldn't close the calculation dialog box).  

                 The changes i made were:  1. added a "close paren" to complete the "test" portion of the IF statement, and   2. In the "result" portion, i changed the colon after "Self" to a semi-colon.  Then i also cleared the checkbox for "Do not replace..."    

                 But, as you can see from the screenshot, "Recommended" is still not getting checked when there's a value in the "RecommendedBy" field.   Thoughts??

            • 3. Re: Having a field enterable based only on another field's value
              philmodjunk

                   Well I left it out and you put it in the wrong place. wink

                   We need this version:

                   If ( IsEmpty ( FilterValues ( Self ; "Recommended" ) ) and Not Isempty ( Recommended By ) ; List ( Self : "Recommended" ) ; self )

              • 4. Re: Having a field enterable based only on another field's value
                vlight

                     Voila!   It works.  What a team!   thanks, again.