6 Replies Latest reply on May 31, 2012 10:51 AM by NaturSalus

    Conditional Value List

    NaturSalus

      Title

      Conditional Value List & Picker Interaction

      Post

      Hello,

      I have been using extensively and with success Phil Caulkins Picker demo (enhancedvalueselection).

      It works fine as long as the record field value you are picking from contains an easily recognized value like a "Digestive System" and not its primary key value, let's say "2".

      The reason I am running into this problem is because the picker is getting values from a related record field that contains the record primary key (__kp).

      The related record from which the picker picks is a field that gets its value from a Conditional Value List.

      So in my case the picker gets the "Disease", "Body Organ" and "Body System" field values from the "Disease" table. The problem lies with the values of the Body Organ and Body System fields that return numbers instead of names.

       

      The established relationships between "Disease" , "Body Organ" and "Body System" is shown in the attached image.

      "BodyOrganDisease" is a second table occurrence of "Body Organ".

       

      In the "Disease" layout based on the Disease TO I have the following fields:

       

      Disease::dCommonName

      Disease::BodySystem

      Disease::BodyOrgan

       

      The conditional value list between the  Disease::BodySystem and the Disease::BodyOrgan fields is set as follows

       

      The Disease::BodySystem field has a Popup menu to "Body System" value list with the following settings:

      "BodySystem::__kp_BodySystem and BodySystem::BodySystem"

       

       The Disease::BodyOrgan field has a Popup menu to "Body Organ" value list with the following settings:

       "BodyOrgan::__kp_BodyOrgan and BodyOrgan::BodyOrgan"

       Include only related values starting from: Disease

      Show values only from second field

       

      My question is, how should I modify the Conditional Value List settings so that they return BodySystem::BodySystem and BodyOrgan::BodyOrgan instead of BodySystem::__kp_BodySystem and BodyOrgan::__kp_BodyOrgan, so that Phil's Picker returns teh disered values ( BodySystem::BodySystem and BodyOrgan::BodyOrgan) ?

       

      Thanks,

       

      natursalus

      relationships.jpg

        • 1. Re: Conditional Value List & Picker Interaction
          philmodjunk

          That demo file has mutliple selection methods demo'd on one screen. Which are you using? the auto complete drop down list on the layout? The one in the line items portal?

          Or one of the search portals at the bottom?

          I believe you are trying to use one of the drop down list methods. If so, I think you missed a key detail in how they work.

          The dropdown lists can autocomplete on text entered into the field because the drop down list is a list of names, not ID numbers. A script then uses the entered name and performs a find in order to capture the ID number of the record thus found and enters that ID number where needed on the original layout. Since the name might not be unique, this script includes code that pops up a list of records found when that happens so that you can then select from the list of matching entries by clicking one.

          The value list for the drop down can't be one that uses the ID number as the first field as then it can't auto-complete. (That's the whole reason I came up with this method in the first place, I wanted to use auto-complete to narrow my list of possible choices, but still enter an ID number.)

          For those interested, the current download link for this demo is: https://www.dropbox.com/s/0pm1gdqcfi2ndpv/EnhancedValueSelection.fp7

          Plese note that it was upgraded a while back to eliminate the need for the Refresh Window [flush cached join results] script step so if your copy still uses that script step, you might want to download this file again to see how we managed to eliminate that issue.

          • 2. Re: Conditional Value List & Picker Interaction
            NaturSalus

            Hello Phil,

            I have the most recent version of your demo file. It has allowed me to surpass FM11 limitation on listing lengthy value lists. I haven't tried the value list improvement of FM12, but based on FMI description I will continue to use your approach for years to come (it's all up to FMI...)

             

            The option that I am using is the one you helped me to implement and understand some posts back.

            The implementation is on a portal and corresponds to the one on the left corner, the one that has the Pattern Matching Search.

             

            I know the the problem is with my COnditional Value List because if I just write down the values on the BodySystem::BodyStem and BodyOrgan::BodyOrgan fields the Picker shows the entered values on the portal.

             

            So, what do you suggest to do?

             

            Thanks,

             

            natursalus

            • 3. Re: Conditional Value List & Picker Interaction
              philmodjunk

              It's still the same issue. The conditional value list must have a name field as field 1, not the ID number.

              • 4. Re: Conditional Value List & Picker Interaction
                NaturSalus

                 

                The conditional value list must have a name field as field 1, not the ID number.

                 

                In the Body Organ layout to Body Organ TO there are two fields:

                 

                BodyOrgan::_kf_BodySystem

                BodyOrgan::BodyOrgan

                 

                Are you saying that it can't be BodyOrgan::_kf_BodySystem?

                 

                So, in plain English are you saying that the Conditional Value List settings are wrong?

                 

                natursalus

                • 5. Re: Conditional Value List & Picker Interaction
                  philmodjunk

                  You can use a conditional value list, but you need BodyOrgan, not the kf field as field 1 in the value list.

                  • 6. Re: Conditional Value List & Picker Interaction
                    NaturSalus

                    Phil,

                     

                    Got it!

                     

                    Thanks,

                     

                    natursalus