Since you would like to use a form on the same layout, you can use a bunch of globals fields to enter the data into.
Then in your add script, you would capture the pkCustomerID into a variable, go to a layout based on the child CallReports layout, create a new record, set the foreign key with the $customerID variable value captured earlier, set the other fields with the values in your global fields, commit the record and then go back to the orig layout.
Set Variable [ $CustomerID; pkCustomerID ]
Go tot Layout [ CallReports ]
Set Field [ fkCustomerID; $CustomerID ]
Set Field [ Notes; gNotes ]
Set Field [ OtherReportInfo; gOther ]
Go to Layout [ Original ]
As for displaying the newest records on the top of the portal, you can always have the portal sorted descending by the record creation date, which you should capture if not already.
When I add the set field command in the script I can only specify one field so I am not sure how I add
Set Field [ fkCustomerID; $CustomerID ]. Sorry for being such a noob.
Click the specify button next to calculated result.
When I do that and enter Call Report::CR_Date; Call Reports::g_CR_Date it tell me and expression is required like it wants me to enter a + or - instead of the ;.
No when specifying the target field, you will choose Call Report::CR_Date.
When specifying the source, you will choose calculated result and then specify Call Reports::g_CR_Date.
Ok the problem I have now is that it is creating a new customer record but I just want to add a new record to the Call Reports table for the existing customer.
You are not going to a layout based off your callreports table and creating the new record. Relook at my previous posts. I think you will ahve found that you missed a step.
That did it. Thank you so much for your help.