If you have this relationship in manage | database | relationships (but perhaps with different names):
Customers::CustomerID = Invoices::CustomerID
Invoices::InvoiceID = Lines::InvoiceID
Then you can use a portal to Invoices on your History layout to display all invoice records for that customer. You can add the Lines::Description field from the Lines table to this portal row and it will show the first related line record.
Thank you - got it working now on the whole. Two glitches though..
1/ One of my fields on the poral is for Net Value. It appears on the first line of the poral but not any anything below.
2/ I have a go to related record on each line so I can view the original order/quote/invoice (diff layouts depending on what type of order). But the script I have written takes me to the first line on the portal's order..
1) you'll need to tell me more about that field. How is it defined? in what table?
2) I'd need to see your script. Typically, this is the result if some script step that precedes the go to related records step moves the "focus" out of the clicked portal row. In one recent case, a poster was opening a new window before the GTRR step.
To post a script to the forum:
- You can upload a screen shot of your script by using the Upload an Image controls located just below Post A Answer.
- You can print a script to a PDF, open the PDF and then select and copy the script as text from the opened PDF to your clipboard for pasting here.
- If You have FileMaker advanced, you can generate a database design report and copy the script as text from there.
- If you paste a text form of the script, you can use the Script Pretty box in the Known Bugs List database to paste a version that is single spaced and indented for a more professional and easier to read format. (Use the HTML option on the database tab panel and paste the text into the forum's HTML editor.)
Attached is my script..
The 'History' layout is using records from the customers table. It contains fields in the portal (invoice details) from Lines and Invoice details. The "Nett price" field I am having trouble with is from Invoice details table. But there are a few other fields on the portal also from Invoice details, and these show fine on the other rows.
Anyything else you need?
Yep, your script has the same problem that I saw in another poster's script. The New window command changes the focus and thus your GTRR step goes to the first related record.
Remove the new window steps. You don't need them. If you want this to open in a new window, select the new window option from within the GTRR steps.
How is the net price field defined?
How did you add it to your portal row? (any chance that it's a pixel too far to the side and thus isn't really "in" the portal?)
Perfect - all issues sorted...If only all of my FM problems were as simple to resolve!