You might or might not need a script.
Actually this can be created in a very simple way.
Depending on how you want to display your notes.
If your notes can be displayed in a portal it would be sufficient to create a new table "Notes"
I don't know anything abou your current setup so I'll be a assuming you have a "Contacts" table and that that table had a field "ID" which is a Number field with auto enter serial number.
In your "Notes" table you need following fields:
Id - A number field with auto enter serial number.
ContactIdFk - A number field (FK stands for foreign key, here we will store the ID of the contact thatn this note is linked to)
Note - A text field.
Date - a Date field - This is optional, but it might be handy to know when a note was created. You can set this to auto enter Date on creation.
Then in the relationships view "File" - "Manage" - "Database" - "Relationships"
Create a relationship (drag one field to the other) between:
Now double click the [=] sign to edit the relationship and check the boxes on the Notes side of the relationship for "Allow creation of records..." and "Delete related records when...."
Not on a layout based on your contacts table create a portal that's based on the notes table. Add the fields Note (first) and Date (second)
In the portal add a Delete button that performs as it's button action a "Delete portal row" step. To delete notes.
I have a text field on a layout that I use to keep notes about a case. This script will move to the notes field and insert a timestamp and username and then move the cursor to allow the user to enter the text. It adds new notes to the same field above previous notes.
Very simple old school.
Two Text Fields - "NoteNew" and "Notes"
Two Buttons - "New Note" and "Add To Notes"
New Note Button Script
Set Field [Table::NoteNew; GetAsText(Get(CurrentDate)) & ", " & Hour(Get(CurrentTime)) & ":" & If(Minute(Get(CurrentTime)) < 10; "0" & Minute(Get(CurrentTime)); Minute(Get(CurrentTime))) & " - "]
Go To Field [Table::NoteNew]
Add To Notes Button Script
Set Field [Table::Notes; Table::NoteNew & "¶" & "_______________" & "¶¶" & Table::Notes]
Set Field [Table::NoteNew; ""]
Notes Displayed in one large long note, newest to oldest.