5 Replies Latest reply on Jun 5, 2013 2:43 AM by CG_1

    Help auto-fill table? and alternatives

    CG_1

      Title

      Help auto-fill table? and alternatives

      Post

            

           I'm creating a database where the workers from each shift, have to fill in related data.

           I'm using a layout with general fields that need to be seen all the time, and portals within tabs.

           I have a table for equipments, that has ID and Equipment Name, so that the Admin can change, add and delete equipments.

            

           Now, I need the workers to be able to add data related to each of these equipments, every shift, in a "table" where we have, for example:

           - 1st column -

           EQUIPMENT

           equip1

           equip2

           equip3

           equip4

           (all the equipments inserted on equipment table and are auto-filled according to that table)

            

           - 2nd column -

           hours (for each)

            

           - 3rd column -

           notes (for each)

            

           SO, probably it can't be done like this but I would appreciate some help finding a solution.

           Oh and this "table" should be within a tab and portal.

            

           Thanks in advance

        • 1. Re: Help auto-fill table? and alternatives
          philmodjunk

               That's all quite possible in FileMaker.

               Your description of your situation is incomplete so I am guessing at some of the details. I am assuming that you need one table per shift (or day) for all the equipment in your equipmentlist.

               Shifts-------<Equipment_Log>--------EquipmentList

               Shifts::__pkShiftID = Equipment_Log::_fkShiftID
               EquipmentList::__pkEquipmentID = Equipement_Log::_fkEquipmentID

               For an explanation of the notation that I am using, see the first post of: Common Forum Relationship and Field Notations Explained

               Equipment_Log would be the table where you record data in your three columns. You can set up a portal to it on the Shifts layout to record this data.

               To "pre-load" that portal with a list of equipment, you would use a script similar to this, performed by clicking a button on the shifts layout:

               Freeze WIndow
               Set Variable [$ShiftID ; Value: Shifts::__pkShiftID ]
               Go to Layout ["EquipmentList" (Equipement List)]
               Show All Records   ----> or perform a find if you just want only some of the equipment in the table to be listeed
               Go to Record/Request/Page [first]
               Loop
                  Set Variable [$EquipId ; value: EquipmentList::__pkEquipmentID ]
                  Go to Layout ["Equipment_Log" ; (Equipment_Log)]
                  New Record/Request
                  Set Field [Equipment_Log::_fkEquipmentID ; $EquipID ]
                  Set Field [Equipment_Log::_fkShiftID ; $ShiftID ]
                  Go to Layout ["EquipmentList" (Equipement List)]
                  Go to Record/Request/Page [next ; Exit after last]
               End Loop
               Go to Layout [original layout]

          • 2. Re: Help auto-fill table? and alternatives
            CG_1

                 Hi there.

                 Thank you for your quick response. I was only able to try it out right now.

                 So, when I use the button associated to the script you recommended, it fills the ShiftID ok, but the Equipment id, instead of an "array" it retrieves the last EquipID entered...

                 Any thoughts?

            • 3. Re: Help auto-fill table? and alternatives
              philmodjunk

                   There is no "array" in my suggested solution. The design I am recommending has one record for each item of equipment in the equipment list table.

              • 4. Re: Help auto-fill table? and alternatives
                CG_1

                     Maybe I didn't explain myself correctly, but wasn't the goal of your design, as the button with the script was pressed, to create the arrows with the correct shift id and with each equipment on each row? So i could insert the other data, related to them? I called this "array", 'cause it's kind of a vertical array of all equipments on one column.

                     Example (3 equipments, shift 1)

                Column 1 - SHIFT

                     Shift ID (it's correct)

                Column 2 - EQUIPMENT

                     Equip 1

                     Equip 2

                     Equip 3

                     (creates 3 rows - autofills with each equipment on each one of rows)

                Column 3 and 4 - HOURS AND DESCRIPTION

                     Side by side with each equipment

                • 5. Re: Help auto-fill table? and alternatives
                  CG_1

                  Update

                       Now, when i trigger de script, it lists all the equipments but the last one is repeating continuously till I cancel the process.

                  Update

                       Instead of showing all records as in this script, I've changed it to perform a search, and that way it stopped repeating the last equipment.

                       All done :)