4 Replies Latest reply on Aug 10, 2011 2:27 PM by Matty_1

    Conditional drop-down menu

    Matty_1

      Title

      Conditional drop-down menu

      Post

      Hello,

       

      I have a Interim table and a contract table.  They are currently related by contract number.  Most times the Interim slips are created through a portal on the contract side but sometimes an Interim needs to be created without assigning a contract number (to be filled in at a later date)  I was able to create a drop down list that shows me all the contracts associated to the particular client but what I would to see is a drop down list that only shows open contract numbers for the particular client.

       

      Thank you in advance for your help!

      M.

        • 1. Re: Conditional drop-down menu
          philmodjunk

          InterimTable::ContractNumber = ContractTable::ContractNumber

          but sometimes an Interim needs to be created without assigning a contract number (to be filled in at a later date)

          I can only assume that this is done on a layout based on Interim?

          I was able to create a drop down list that shows me all the contracts associated to the particular client but what I would to see is a drop down list that only shows open contract numbers for the particular client.

          Sounds like you have a third table here, clients. How is it related to the other two?

          How do you know which contract numbers are "open"? Is this controlled by a status field in "contracts"?

          If so, you can define a calculation field, constOpen, to return whatever value in Contracts marks a contract as "open".

          Then you can use this relationship for your conditional value list:

          Interim::ClientID = OpenClientContract::ClientID AND
          Interim::constOpen = OpenClientContract::StatusField

          Now your conditional value list can display values from OpenClientContract, Include Only Related Values, starting from Interim.

          OpenClientContract is a new occurrence of Contract created by selecting it in Manage | Database | Relationships, then clicking the button with two green plus signs.


          • 2. Re: Conditional drop-down menu
            Matty_1

            Interim::ContractNumber = Interim_Contract::ContractNumber

            Already done.

            I can only assume that this is done on a layout based on Interim?

            Yes.

            Sounds like you have a third table here, clients. How is it related to the other two?

            I do, they are both related to it based on the client name.

            How do you know which contract numbers are "open"? Is this controlled by a status field in "contracts"?

            Yes.

            -----

            I currently have a new occurrence setup called "Interim_OpenContracts" related to Interim via the client field.  What I'm not fully understanding is the constOpen.  The issue is that I can often have several unfinished contracts for one client.  Instead of seeing every contract ever issued to the particular client I would like to see only the contract numbers that have a status of "Open"

            • 3. Re: Conditional drop-down menu
              philmodjunk

              if "Open" is the text entered in the status field in contracts, define constOpen as a field of type calculation. Select "text" in the return type drop down. Enter "Open" with the quotes as it's calculation. This field will have the same value in every Interim record so you can use it as a "filter" in the relationship to match only to contract records with that status.

              If you enter a different value in the status field or there could be several different values entered that identify it as "open", then this calculation would need to be more complex.

              This still assumes two more key details: a) the status field in contracts is of type returns text. b) the status field in contracts is a stored field. (Not, an unstored calculation, for example.)

              • 4. Re: Conditional drop-down menu
                Matty_1

                Thank you!