Assuming that key field is named "InvoiceID" and that the parent table is named "Invoices", your script would look like this:
Set Variable [$InvoiceID; Value: Invoices::invoiceID]
Go To layout [LineItems ]//select the layout you have in your file here
Enter Find Mode
Set Field [LineItems::InvoiceID ; $InvoiceID]
Set Error Capture [on] //keeps dialog box from interrupting the script if there are no line item records to find
Thanks so much for your quick response.
I hit a snag on the 4th line of the script: "Set Field [LineItems::InvoiceID ; $InvoiceID]"
When you say 'LineItems', are you referring to the original line items table/layout or are you referring to my new list report layout? B/c if you are referring to my new list report, that does not have its own table, and thus is not listed. The list report shows records from the line items table.
If you are in fact referring to the original line items table, i tried that, but when i tested the script it took me to the line items layout (not the list report) and was automatically entered into find mode.
Let me know.
Why would you not use a Go to Related Records script step using the portal relationship and specifying the list layout?
TS_Oz, FileMaker Inc.
Go To Related Records also works. It can, however, be a bit harder to accurately describe in a forum post when you don't know the exact names of the table occurrences involved. The end result, from the user's perspective, is the same.
LineItems is my guess as to the name of the table on which you've based your layout. Please select the actual table occurrence and field name that you've actually used in your database.