8 Replies Latest reply on Feb 1, 2015 4:27 AM by disabled_Luna.media

    How can I create a list of companies with its empoyees?

      Hi there,

       

      I have a (for me) difficult task to develope. I have a table "Companies" and a table "Employees". Now I want to create dynamically lists of companies (each time for a special selection that I can perform via a script, no prob) and show "under" each company a list of (only current active) employees. Companys and employees shall have a "box" to tip on or off (whether the company or person should be in e.g. a mailing).

       

      And idea were to start and how to achieve this? Thanks in advance,

      Luna

        • 1. Re: How can I create a list of companies with its empoyees?
          wimdecorte

          The easiest is to build a layout on the Employees table, add a subsummary part "when sorted by" company name, sort by company name.

           

          When you script going to that layout you need to make sure you sort first by the field specify in the subsummary part.

          • 2. Re: How can I create a list of companies with its empoyees?
            electon

            Companies are related to Employees by company id right?

            Depends on how you want to display the data. One possible solution is to create a list view layout from Employees, create a sub summary based on company id and put the related company data in the sub summary, employee data in the body. The found set would need to be whatever selection you made, constrained by only active employees and sorted by company id.

            It would look like this:

             

            Sub summary:      Company A

            Body:                         Employee 1

                                              Employee 2

            And so on.

            Is this what you're looking for? It's like a report but a form in list view.

            • 3. Re: How can I create a list of companies with its empoyees?

              Thanks for both hints. I think I will play a bit around and should come to a solution that will fit here for displaying companies and employees.

               

              But do you have a suggestion how it will be possible to toggle a check field (on companies as on employees) so that these checked records can be written to a different table and there then used later on? Like "send these (formerly checked) companies (centrally) and the employees (directly) a certain info bulletin.

               

              First I thought of just a field that will be read and written away after checking the list through. Could work in a single-user-world and if there are no other places that could parallely also use this field in another checking list. Will say: seems not to work. Then I thought I could create for each displayed line a record in a separate table and tidy it up afterwards (unchecked records in the bin, checked one already in place where I can use them further on). But this seems so inelegant.

               

              Any suggestions?

              • 4. Re: How can I create a list of companies with its empoyees?
                electon

                You could create a separate table related to Employees for checked items with relevant data and "allow creation of records via this relationship" enabled. Put the checkbox in that table, link by whatever field(s) for the relation to work, parent data may not be empty otherwise it won't work. The checkbox from that table must be on the layout record row. When you enable the checkbox a related record will be created in the other table.

                This will work for records in the body, for records in sub summary it will check only the first record.

                Another TO of the table with create enabled, linked in a different way?

                For unchecking, unfortunately no easy way. Either keep the data and only use when "checked" or script a delete of that record.

                Generally that's the idea.

                • 5. Re: How can I create a list of companies with its empoyees?
                  keywords

                  I once built an emailing application for a client with an interface containing a portal to bring up related contact records in various combinations. Level 1 was a global field formatted as a checkbox set to enable them to select broad groups of records, with a scripted button to select the lot if desired. Level 2 was a boolean on/off field (one/zero displayed as an X and configured as a button that ran a script which toggled between the two) on each portal row, enabling them to select or deselect individual contacts as required; there was also a button to select/deselect all contacts. Finally the emil script scrolled through the portal sending the email only to those contacts checked.

                  • 6. Re: How can I create a list of companies with its empoyees?

                    Yes, good idea. Why not just use a button (or two) to select or unselect a portal row. The scripts behind them do the magic (creating or deleting a record in a related table). This helps me to get on the right track. Thanks!

                    • 7. Re: How can I create a list of companies with its empoyees?
                      docge1951

                      For my job, I've a solution (excuse my bad English). I've a file "Company" and a file "employes". Each Company have unique ID. That ID is present in the file "Employes" (each employes have ID of their Company). Then the two files are related on ID of the company. Then, in the file company You can create a portal field to see the employes of each company. My solution work well (I'm phiscian)

                      • 8. Re: How can I create a list of companies with its empoyees?

                        Thanks, your English is fine! Unfortunately I llooked for another task,

                        but anyway thanks for the advice.

                         

                         

                        Am 01.02.15 um 12:51 schrieb docge1951:

                        <https://community.filemaker.com/?et=watches.email.thread>

                         

                        >

                            How can I create a list of companies with its empoyees?

                         

                        Antwort von docge1951

                        <https://community.filemaker.com/people/docge1951?et=watches.email.thread>

                        in /Discussions/ - Komplette Diskussion anzeigen

                        <https://community.filemaker.com/message/171917?et=watches.email.thread#171917>

                        >