3 Replies Latest reply on Aug 15, 2011 12:23 PM by philmodjunk

    'Add a Note' button



      'Add a Note' button



      i'm pretty much a novice to FileMaker Pro but am loving the functions I have already explored and used to create a database for my business. I created a new databse and layout from scratch but I now want to add a button that inserts a new note for the contact record each time i press it and leaves a date & time stamp with the note (like that in the 'Contact Management' Strater Solution in FM Pro 11). Can anyone explain to me (in non-tech language please as I'm new to this - sorry) how I can create what I was hoping is a simple action? Any help would be much appreciated.

      Many thanks in advance Smile


        • 1. Re: 'Add a Note' button

          You should have a contactID serial number field defined in your contacts table. If not, add one.

          Your notes should be recorded in a separate table. It should have at least the following fields:

          CreationTimeStamp ( TimeStamp, set it to auto-enter the creation timestamp )
          ContactID (Number field)
          NoteText ( Text Field )

          In manage | Database | Relationships, drag from ContactID in one table to ContactID in the other to produce this relationship:

          Contacts::ContactID = Notes::ContactID

          On your Contacts layout, add a portal to Notes and put both the CreationTimeStamp and NoteText fields in the portal. You'll probably want to sort your notes in Descending order by the CreationTimeStamp field so that the newest note is listed at the top.

          Your Add Note script can be:

          Freeze Window
          Set Variable [$Notes ; Value: Contacts::ContactID ]
          Go To Layout ["Notes" (Notes)]
          New Record / Request
          Set Field [Notes::ContactID ; $ContactID ]
          Go To Layout [original layout]

          I figure it's pretty likely you'll get stuck on a few of the details to doing this. Feel free to post back here with follow up questions if that happens and I'll spell that part of the process out in greater detail.

          • 2. Re: 'Add a Note' button

            Hi Phil - Thabks for the post - much appreciated.

            Sorry to be a pain. By Contact ID I'm assuming that this could be a uniqe refernce number for each contact? Also when you say a seperate table do you mean create a new form?

            If so, I have tried this and get as far as the: In manage | Database | Relationships part but I only appear to have one box in the screen that pops up. I'm guessing I've missed something?



            • 3. Re: 'Add a Note' button

              Yes, Contact ID would be a serial number field you define in the contacts table.

              Forms and tables are two different things. (We call forms "Layouts" in FileMaker BTW.)

              Create a new table on the tables tab. Then click the fields tab and define the fields that will make up a record in this new table. Now, you'll find that FileMaker has automatically created a new Table Occurrence Box on the Relationships tab of the same name as your table and it has created a new layout with this same name that refers to this Table Occurrence. While the layout and occurrence have the same name as the table, they really aren't the same thing. You can create multiple layouts that all refer to the same table occurrence and you can create additional table occurrences that refer to the same table so that you can define more than one relationship between them.

              If you want to learn more about table occurrences and how to use them. See this tutorial on the subject:  Tutorial: What are Table Occurrences?