1 2 3 Previous Next 31 Replies Latest reply on Nov 16, 2011 12:32 PM by philmodjunk

    Add a Note Script

    sunwelding

      Title

      Add a Note Script

      Post

      Hi, Never have used the script.  I would like to create a button that creates a note with the username, time, and date.  Exactly like the button used in the contact management start up database. I'm not sure where to start on creating a script.

        • 1. Re: Add a Note Script
          philmodjunk

          FIrst, what tables have you set up in your database?

          The starter solution sets up a related table and uses  portal to display the notes entries.

          Do you have the same?

          • 2. Re: Add a Note Script
            sunwelding
            Date_Created
            Date_Modified
            k_ID_Record
            kf_ID_Contact
            NoteInfo
            Text
            TimeStamp_Creation
            TimeStamp_Modification
            UserName_Created
            UserName_Modified

            I have all of these just like the starter solution. In a table. 

            • 3. Re: Add a Note Script
              philmodjunk

              The starter solution has a separate table called Notes that is linked to the contact management table in this relationship:

              Contact Management::K_ID_Contact = Notes::KF_ID_Contact

              You should create a similar relationship if you want to attach multiple notes to a single contact.

              • 4. Re: Add a Note Script
                sunwelding

                Ok yes, I have the relationship Contact Management::K_ID_Contact = Notes::KF_ID_Contact

                • 5. Re: Add a Note Script
                  philmodjunk

                  Have you looked at the "add a Note" script in the starter solution?

                  You can use Script Manager to import this script into your new file. If layout, table occurrence and field names are exactly the same, the script should import and work for you with no trouble. If there are some differences, FileMaker will tell you that some errors occurred during import and you can open the script in the script editor to fix the steps that can't find the right layout or field to refer to.

                  • 6. Re: Add a Note Script
                    sunwelding

                    I imported the script.  1 error Notes_Utility missing.

                    Now I have created the button "add a note" and when I click the button it looks more like a new record is added rather than a not on that record.

                    The script in the starte solutino looks different than when I imported it.

                    • 7. Re: Add a Note Script
                      RonCates

                       Just at a glance it looks like Notes_Utility is probably the layout based on the notes table that the script goes to to create the new note record. If your layout is not named the same the script, not being able to find the layout it's looking for, will stay on the same layout and create a new record there. You will need to have a layout based on your notes table with the name Notes_Utility or change the name of the layout in the script to match whatever name you have for your layout.

                      This is assuming I am correct and Notes_Utility is a missing layout.

                      • 8. Re: Add a Note Script
                        philmodjunk

                        The script does create a new record, that's also what it does in the starter solution, but it should create that new record in the notes table.

                        What did you do to correct the "notes_utility" error?

                        This is a layout based on the Notes table. Your script must use go to layout to switch to a layout based on notes in order to create the needed new record.

                        • 9. Re: Add a Note Script
                          sunwelding

                          So I need to create a new layout and call it Notes.

                          Not sure how to correct the "note_utility" error. Don't know where to find it. 

                          • 10. Re: Add a Note Script
                            philmodjunk

                            So I need to create a new layout and call it Notes.

                            Almost. The new layout needs to refer to the notes table in Show Records From in layout setup. You can name it anything you want.

                            Not sure how to correct the "note_utility" error. Don't know where to find it.

                            This is an error you reported after import. If you open the script, in the script editor, you should see a go to layout step with a "missing" or "unknown" type of error inplace of the name of your layout. You need select this step and specify the new layout based on Notes that you should have created.

                            • 11. Re: Add a Note Script
                              sunwelding

                              Ok, I created a layout "Notes".  I went to "Layouts", "layout set up" the layout name is Notes. Show from records from"Notes".

                               

                              The button says "script can not be found or has been deleted" 

                              • 12. Re: Add a Note Script
                                philmodjunk

                                Enter layout mode. Double click the button. What pops up in the dialog box? Is a script named? If no, select perform script and specify the script you have imported.

                                • 13. Re: Add a Note Script
                                  sunwelding

                                  Yes, I have done all of that.

                                  Question: Which field do I place in the sales order layout? 

                                  • 14. Re: Add a Note Script
                                    philmodjunk

                                    Yes, I have done all of that.

                                    Did that resolve the issue or do you still get the error message?

                                    Question: Which field do I place in the sales order layout?

                                    I would think you'd need to add a portal to Notes on your layout so that you can see all the associated notes, not just one. And then you'd place the Notes field inside this portal.

                                    1 2 3 Previous Next