4 Replies Latest reply on Feb 25, 2015 11:24 AM by theaudone

    'select' display on layout best practice question

    theaudone

      Title

      'select' display on layout best practice question

      Post

       

      Hi,

      I'm trying to write a simple script to display an employee's full name after their employee ID is selected from a drop down. What is the best way to show the employee name? Do I display it in an edit box? A text box? I'm not sure what the right object type for display should be...

      Right now I have a drop down list that shows the employee's last name and employee ID together, but after they select I want to display the full name of the employee at the top of the tab, and eventually a picture too (just haven't gotten that far yet.)

      Thanks in advance...

        • 1. Re: 'select' display on layout best practice question
          philmodjunk

          That would depend on what you are trying to do with this information. You might be creating a new record that links to the employee's record, it might copy data from that record or just display it. Or you might be finding that employee record in order to view and update it.

          In some situations, it's all a matter of setting up a relationship to link the drop down list field's employee ID value to an occurrence of the employee table specifiying the employee ID field in that table as the other match field in the relationship. In other cases, you will want a script to perform a find for that employee's employee record.

          So you need to describe both your layout and what you want to do with the employee data in more detail.

          • 2. Re: 'select' display on layout best practice question
            theaudone

             

            Hi,

            To answer your first question, I'm just finding the employee record and viewing it.

            I have an employee table, primary key empID, with a relationship to a performance evaluation table, and the layout I'm working with is to create a new performance evaluation for that employee. (Please see image of my two tables with relationship.)

            I guess I'm asking in general, when designing a Layout, when a record lookup is performed, what type of object is correct to display the data. Is it an edit box that is then populated? 

            I apologize in advance, I know I'm making a really simple question complicated...

            • 3. Re: 'select' display on layout best practice question
              philmodjunk

              sorry, but from my perspective, your first two statements contradict each other. You are not just finding an employee record, you are linking a new record in perf_eval to an existing record in emp.

              Your relationship seems to have two pairs of match fields where there should be only one. So I will rewrite your relationship, then describe how to do what you appear to need here:

              emp::__pkEmpID = perf_eval::_fkEmpID

              __pkEmpID should be defined to auto-enter either a serial number or the result of Get ( UUID ) in order to uniquely identify each record in Emp. One of the two fields that you have in emp and use in this relationship may already be defined in that manner. If so use that field where I use __pkEmpID. _fkEmpID would be defined as either a simple number field (serial number pk) or a text field (UUID pk). Again, use one of your fields in place of _fkEmpID if you can. But don't use two pairs of fields like you have currently set up as that is an unnecessary complication you should avoid.

              In the Emp table, define EmpFullName as a text field with this auto-enter calculation: Last Name & ", " & First Name. In Field Options, specify "unique values" on the validation tab.

              On your layout that specifies perf_Eval in Layout Setup|Show Records From, format _fkEmpID with a value list. This can be a drop down list or a pop up menu. There are differences in appearance between these two options so feel free to experiment to determine which you like best. Define a "use values from field" value list to be used with this field's pop up menu or drop down list. Specify __pkEmpID as the first field and EmpFullName as the second field. Selecting an employee from this value list will select an employee by name, but enter their ID so as to link the perf_Eval record on your layout to this selected emp record. You can now include any field from emp on your perf_Eval based layout and these fields will show data from the selected employee's record once you have selected them in your _fkEmpID field.

              Note: This is the "beginner level" approach for performing this kind of task. It's simple to set up but really only works for a fairly small list of values in the value list. There are a number of ways to make selecting an Employee from a list a much more user friendly task than the above value list.

              You might check out the Adventures in FileMaking series for ideas on where to go from here. Adventures 1 and 2. They are free to download.

              Adventures in FileMaking #1 - Conditional Value Lists (includes details on how to set up a basic field based value list)
              Adventures in FileMaking #2 - Enhanced Value Selection (what to do when a simple value list won't cut it.)

              Caulkins Consulting, Home of Adventures In FileMaking

              • 4. Re: 'select' display on layout best practice question
                theaudone

                OK, thanks very much.