4 Replies Latest reply on Jan 9, 2012 7:07 PM by LaRetta_1

    Populating layout fields with drop down menu

    DavidEnns

      Title

      Populating layout fields with drop down menu

      Post

      I have two linked tables trails::trail_ID to obstacles::trail_ID (parent child, one trail many obstacles). Obstacles is a portal. I have a drop down field called trails::trail_Name which I want to be able to pick different trails from and then have the whole layout refresh with the appropriate records/info. I also wish to trigger a new record if someone enters a new trail name. I've tried and can"t seem to make this work. Any help would be appreciated.

        • 1. Re: Populating layout fields with drop down menu
          LaRetta_1

          Hi David,

          Something appears to be wrong here.  Do you not have a join table as outlined in your prior post and as in the example I provided?  If not then your Obstacles table cannot have a unique ObstacleID.  Either that or your Obstacles table is actually your join table.  Can you clarify?

          Well, you can use a single drop-down list attached to a global and let User select a trail, then select another trail ... which will build a multiline global text of the results.  Then when ready, they click a FIND button and it can run to GTRR to those trails in the same layout. 

          If that selection mechanism does not work for you (drop-down isn't best choice for choosing multiple items), I would suggest that you place a portal of all trails on the layout and let a User click the name they wish.  You have their selections highlight so User can see all trails selected.

          Here is a modified example of your prior file showing how you can handle this using drop-down.  If you wish to instead use portal to all Trails, just use a Cartesian Product ('x' join) but the principle would be the same - write to multiline global and then GTRR to same layout to isolate your Trail records.

          http://www.directlinesolutions.com/downloads/trails2.zip

          You can also just take that multiline list and perform a find, writing to multiple find requests.  :-)

          As for adding a new record in Trails, why not just a New Record script step where they are and let them enter the new trail name in name field already on the layout?

          • 2. Re: Populating layout fields with drop down menu
            LaRetta_1

            Note the merge variable for display of the selected Trails.  You can use portal also.  And selecting the same trail again will remove it from the list.  This same functionality can be replicated in selecting from a portal of all Trail names as well.

            • 3. Re: Populating layout fields with drop down menu
              DavidEnns

              LaRetta

              I've decided to build on your example file. Although I don't understand its fundementals yet (FMP basics) I'm definitely going to trust that you know what your doing. Which table would I add extra trail fields too and which table would I add extra obstacle fields too? Would that be the Trails & Obstacles tables respectively? And when would I add fields to the other tables, if any at all?

              The obstacleID is not unique. For each new trail, the obstacles always start at 1. 

              • 4. Re: Populating layout fields with drop down menu
                LaRetta_1

                Hi David,

                Details about trails go in the Trails table.  This can be trail length, topography, difficulty ... anything specifically addressing the single unique Trail record should be a field in Trails.  Add a new record in Trails when you add a new Trail.

                Details about the obstacles goes in the Obstacles table.  It appears to be just single descriptors and that is fine.  Add a new record in Obstacles when you want to add a new Obstacle.

                TrailObstacles is where selections are recorded ... one record for each Obstacle selected for a specific Trail.  Note that it only has TrailID and ObstacleID.  This is how you 'choose' an obstacle for a trail.  'Allow Creation...' is on between Trails and TrailObstacles so that when you select from the pop-up in the last portal row (the empty one), it adds a new TrailObstacle record.

                "For each new trail, the obstacles always start at 1."

                You may need to convert the data to the new structure.  It should be simple but we would need to see a sample of the data in Obstacles.  If you wish, you can privage message the information (click my profile and send message).

                What is the Obstacle ID then if it is not a unique number?  Do you include the description 'help me' 'qwerty' etc?  IF so, we can use that information.  Your current Obstacles table may BE your TrailObstacles table, as I mentioned before, with just a bit of cleanup to proper ObstacleIDs.

                Each unique 'obstacle' needs to be a record in Obstacles and the ObstacleID should be unique, auto-enter serial.  If you need help setting this up, let us know.   Once we get that squared away, we can address your required functionality on finding many trails; I still do not understand the user perspective.