4 Replies Latest reply on Nov 22, 2011 8:44 PM by rkevwill

    Need a touch of tutoring on a specific task, related, relational, whatever.

    rkevwill

      Title

      Need a touch of tutoring on a specific task, related, relational, whatever.

      Post

      Having used flemaker years ago, extensively, I understand the concepts, but over the years have lost my understanding of certain terminologies, along with all the improvements. If I can get this one next item explained to me, I'm confident I can run with it from here.

      Ok, I have a complete contact DB set up, with all names, addresses, etc. I think I need a separate file, or DB for my next step. I want to make a button, to bring up a "contact form" that shows The name, phone number from the Contact DB, & a date for contact, and the reason for contact. And then be able to search on the contact date, for "today's contact." To clarify, when I click a button, the name and phone number is pasted to the new form, and there is a contact date field for me to fill out, and a text field to say why I am contacting. The button thing I've already figured out, but creating the new "form, or table, or whatever I need" is what I'm stuck with.

      Because of the change in terminology, I just don't know where to start. Under the OLD filemaker, I would just have a separate file, and one would look to another. I am getting a bit confused between the terms related tables and files.

      If I can just get headed into the right direction, even in the help files, that would be good.

        • 1. Re: Need a touch of tutoring on a specific task, related, relational, whatever.
          philmodjunk

          OPen Manage | database | tables

          Enter "contactLog" or a name you prefer and click Create to create a new table. This adds a new table to your existing file as you no longer need to create a separate file as you did in the old "one table to a file" days.

          Just as in the old days, you need a field in Contacts to link to a field in ContactLog. If you haven't already got such a field, click the fields tab, select your original table in the table drop down and add ContactID as an auto-entered serial number. (click options for a selected field or double click it to bring up the field options dialog where you can set up these field options.) Existing records in your Contacts table will not automatically get a serial number--the field will be blank for them. You can use Replace Field Contents to update them with a serial number if this is the case.

          While still in Manage | Database | Fields, select ContactLog from the table drop down and add the fields you want for this. Make sure to include a number field, ContactID so you can link records in this table to records in Contacts.

          Now click the Relationships tab. Each time you create a new table, FileMaker creates a table occurrence "box" with the same name on the relationships tab and a layout of the same name that refers to this table occurrence. Drag from the ContactID field in one table occurrence box to the ContactID field in the other to create a relationship based on these two fields. Double click the line this process creates to open a dialog box where you can specify different options for this relationship. You may find it useful to select "allow creation of records via this relationship" for ContactLog. With this option selected, you can set up a portal to ContactLog on your Contacts layout and enter new records in ContactLog by enterintg data into the bottom blank row of this portal.

          It's also a good idea to select the "Delete...." option for ContactLog, but DO NOT select this option for Contacts. If you did, deleting a ContactLog record would also delete the linked Contact record and this is most likely not something you would want to happen. (But if you delete a contact record, it makes sense to automatically delete any related ContactLog records as these records will become "orphaned"--not linked to any contact and aren't likely to be useful to you once you've deleted their "parent" record in contacts.)

          If you want to click a button on the Contacts layout that creates a new, linked ContactLog record and displays it on the ContactLog layout, use this script:

          Set Variable [$ContactID ; Contacts::ContactID]
          Go To Layout ["Contact Log" (ContactLog)]
          new Record/Request
          Set Field [ContactLog::ContactID ; $ContactID]

          • 2. Re: Need a touch of tutoring on a specific task, related, relational, whatever.
            rkevwill

            Gives me an exercise to do asap (probably thurs evening). One question before I begin....and let me use your terminology from above....will there be separate "files" for each entry in "contactLog?" That indeed is what I am looking for, to print out on a report, sorted and found by a date, on a report form. This report would have separate entries for maybe 10-20 contacts for example.

            • 3. Re: Need a touch of tutoring on a specific task, related, relational, whatever.
              philmodjunk

              This keeps it all in one file. I see no need for a separate file and it is simpler to keep both tables in the same file. You will have different layouts within that file for each table and you can create more, such as your report form as needed.

              • 4. Re: Need a touch of tutoring on a specific task, related, relational, whatever.
                rkevwill

                Thanks Phil,

                I am progressing and remembering things daily now. I'm back into creating buttons and scripts. Having an issue here and there, but working through them:) At least I know exactly the database and forms I need to create, basically duplicating and improving on the oldest filemaker products.