5 Replies Latest reply on Feb 4, 2015 6:34 AM by philmodjunk

    Selecting Values from Drop down list (within portal) then auto populate next field(within portal)...

    GarthTurton

      Title

      Selecting Values from Drop down list (within portal) then auto populate next field(within portal) based on selection

      Post

      Hi All,

       

       

      I'm working on quite a large and seemingly difficult first project and i have hit a wall. 

      I am working on a database which is primarily for recording current customers, current machine inventory and service reports (completed for the machines within the inventory which are in use by specific customers).

      At present i am trying to incorporate a lot of automation to streamline workflow and productivity. I have accomplished quite a bit although cannot solve this current implementation and would really appreciate some experience.

      I am trying to implement a function(within my Service Report table) where within a Portal, a user can select a Model type of machine(via Valued List) which will then automatically populate the related serial number assigned to that specific machine (which is already predefined within another table (Machine Inventory)).

      I am using a LineItem table to record this data to populate additional machines within the same Service Report and also to be able to assign references within (Machine Inventory) to record when selected machines were serviced, providing a link to the existing Service Report.

      So far everything is working except the ability to auto populate the serial number that relates to the specific machine selected. I'm either getting blank or just the first serial number that is recorded in Machine Inventory. I also want to have this serial number set within the LineItem table to make referencing easier.

      I have tried adjusting my relationships and everything else i can think of, but I am absolutely stumped.

      I have tried to explain this to the best of my ability although please seek further explanation if required, no doubt it is a little messy and i'm happy to provide pictures.

      Many Thanks

      Garth

        • 1. Re: Selecting Values from Drop down list (within portal) then auto populate next field(within portal)...
          SteveMartino

          There are many methods to accomplish this but it really depends on a lot of pieces of the puzzle in their proper places.  If I understand you correctly, maybe this will help.

          Assuming your relationships are set up properly (allow creation of related records, etc), Put 2 fields, on on top of the other in the portal row.

          Put the foreign key in the first field.  Make it a drop down, based on a value list of all the primary keys from the Model type  The value list should use values from the Model table primary key.  Check the box at the top ...Also display values from second field and select Model name field.  Check include all values, and check Show values only from second field.  Make this field only allow field entry (from inspector) in Browse mode.  On top of this field, place the other field Model name, and only let this field allow entry in Find Mode. 

          So when you select this field, you see a popup of all the names.  When you select one it actually populates the key field (hidden under the name field), and the model name will appear in the name field.

           

          • 2. Re: Selecting Values from Drop down list (within portal) then auto populate next field(within portal)...
            philmodjunk

            Perhaps this thread on two different ways to get related data to show up on a layout can help: Auto Fill

            • 3. Re: Selecting Values from Drop down list (within portal) then auto populate next field(within portal)...
              GarthTurton

              Thanks Both of you for replying and apologies on my delay getting some appreciation back to you both. 

              I did manage to solve my challenge and redesign my DB with a more elegant design and seemingly easier implementation to the aspect i was wanting to do. Go Figure..

              Anyway, as he solves one, he begets another although i'm not sure if this is entirely myself or possibly a problem with FM.

              I have a Drop down list which populates only with the Models that are currently attached to the particular account and is also based on user selection of the Type of machine(Espresso or Grinder) they are wanting to add.

              Because there are machines with same model although slightly different feature(Different Group Head Quantities(Espresso) or Grinder is for a different coffee bean), I have created a field that Joins Model Name + (GroupAmount OR GrinderUsage) to make it easier for user to select the correct machine they are working on. Now I have this field being displayed temporarily to see if it is working and it is perfectly.

              I have added this to display in the drop down list, for some reason this implements correctly when user Selects Espresso Type yet not Grinder and comes up with ? in drop down although if ? is selected it displays first Grinder Alphabetically. In the drop drown list settings I have:

              Use Values from "Correct TO(ModelName)", 

              Display Second Field from Same TO(The Field that has the Joined Model+Amount/Usage) 

              Display Values from Second Field only.

              Now if i remove Display Second or unclick Display Values from second field only, the drop down list works correctly, although is either ambiguous(displays only model name) or doubles up with Model Name + Grinder Usage.

              Any Ideas what could be effecting this or work around?

              Again happy to supply pictures if the above is difficult to understand

              • 4. Re: Selecting Values from Drop down list (within portal) then auto populate next field(within portal)...
                GarthTurton

                SOLVED...

                Turned out after a chance notice the field that joined the values of ModelName+Amount/Usage "Calculation Result is" was Number not Text!?

                Strange even though this was displaying fine in my layout test, adding this to a drop down list really screwed it.

                Anyway I hope this may help someone in the future not lose as much colour in their hair! 

                • 5. Re: Selecting Values from Drop down list (within portal) then auto populate next field(within portal)...
                  philmodjunk

                  Yep. Value lists reference a field's index in order to produce the list of values displayed (that's how duplicate values get omitted BTW). A number field doesn't have the right index for a value list of text values.