Q1, do you need a separate layout?
If you place a portal to Notes on your customer layout, you can add, delete and edit all the notes for that customer directly on your customer layout.
This script will take the current customerID and enter it into a new note record on your notes layout:
Set Variable [$CustID ; value: Customer::CustomerID]
Go to Layout [Notes (Notes)]
Set Field [Notes::CustomerID ; $CustID]
Such a script can be useful even if you decide to use the portal as you can include freeze window at the start and Go to Layout [original Layout] at the end and the script will add a new note that automatically appears in your portal. If you sort your notes in the portal so that the most recent note is at the top of the list, this script becomes useful as adding a new note directly in the portal requires scrolling to the end of the portal records, entering the data and when you exit it pops back to the top.
Q2: Use the portal. This is something you can research in FileMaker Help to learn more.
Question, where do I place the script? I have the script assigned to the "add note" button on the customer layout and it still does not work correctly.
The reason for the note portal not on the customer screen is I want the customer layout read-only but I want users to be able to add notes for each customer.
The rest of the layout can be read only yet permit adding notes in the portal.
The script should work for you. "it still does not work correctly" does not tell me how it failed for you.
Exactly what happened when you tried the script?
The script assumes that there is already a value in the Customer::CustomerID field.
Also, if you see more than one pair of  in your set field step, it's not correctly set up and you won't see a value appear in the notes::customerID field.
The "add note" button did the same thing as before adding the script to it. The button will take me to the notes layout as a new record but does not add the parent contactID to the notes table.
Yes, on the customer layout page, I have the customerID displayed. I also have a field on the notes layout page for the parentID to display so I can see if it is working.
Attached is a pic of my tables.
Yes, but what does your script look like?
I suspect you have a detail in that script not quite right.
The set field step should look exactly like this:
Set field [Notes::_fkContactID ; $CustID]
The set variable step should look exactly like this:
Set Variable [$CustID ; value: Contacts::Contact ID Matching Field]
_fkContactID should be a field of type number and Contact ID Matching Field should be defined as either an auto-entered serial number or with an auto-enter calculation that enters Get ( UUID ).
You may need to upload a screen shot of your script in the script editor.
Set variable [$ContactID; Value:Contacts::Contact ID Matching Field]
Go to Layout ["Notes" (Notes)]
Set Field [Notes::_fkContactID]
The difference is the last line. In the Set Field, I can not add the ; $CustID. FM v12 for Windows will not allow it. When I click on the "specify target field" button, this the screen that appears.
This is a common "newbie" mistake with set field.
When Setting up Set Field, there are two Specify buttons that must be clicked. To get Set Field [Table::Field ; Expression], add set field to your script and click the first button (specify target field). Select Table::Field from the list of fields. Do not click the specify button next to the repetition box. Click OK to close this dialog box. Now click the lower specify button (calculated result) and create the expression to the right of the semicolon (;). Do not try to type in the semicolon.
The specify target step is correct. That field is the field you are going to set your variable to.
You also have to specify which value you will be setting. And that can be done by clicking the "Specify" button after "Calculated Result"
That's where you set the value.
And in ths case that value is:
Thanks again PhilModJunk!!
That was it. Script works now. Yahoo!
One minor question though, when the script takes me to the notes layout page, the most recent note in the table is displayed. Should a "new" record be created?
Yep.. That's what New Record/Request does in this script.
You should see Notes record that is blank, except for the value in the ID field.