I don't understand what a layout tab is, and how it's divided into columns. Could you post a pic?
If I understand, you probably need a second table occurrence of the W table to show the details, related to the first W table. Then clicking on a button in a portal row should capture the primary ID, enter find mode, set the primary key ID on the detail tab panel (or wherever it is) and perform find.
See if this is on the right track
Instead of GTRR, create a second Tutorial: What are Table Occurrences? of W
P::__pkProductID = W::_fkProductID
P::_fkWorkID = W|Selected::__pkWorkID
Set up a button inside the portal row that does this:
Set Field [P::_fkWorkID ; W:__pkWorkID ]
Commit Records ---> you may not need this step. Add it if the layout doesn't update until you click a blank area of the layout
Then add fields to your layout from W|Selected and they will update to show data from the selected W record when you click its portal row button.
Thanks Phil and Steve for your input, unfortunately I have been going round in circles on this most of today. Steve, the example you sent is exactly what I wish to do however the layout is based on the products table whereas my table is based on a completely different file. Which seems to be making everything really tricky, for me anyway. I did finally manage to get it to display the record from the portal using a global join and having a portal list on one side of the screen and a single portal display on the other side that shows the selected record. However when I click the portal to create a new record, two records are being created, not one! Ugh! So, I removed the add record option from the portal list occurrence and put a create record button on the layout but that lead to all sorts of difficulties so this was finally abandoned. I don't understand why I am having so much trouble with this, I know it must be something basic I am doing wrong but I cannot find the issue. Clearly I need to go back to words of one syllable.......
It doesn't sound like you tried my suggested approach--which is quite different from what Steve recommended.
However when I click the portal to create a new record, two records are being created, not one!
Not really. From here, it sounds like you were confusing the blank "add row" that is a standard feature of FileMaker Portals when the "allow creation of records via this relationship" option is enabled. This appears to be an additional blank row in your portal and is put there precisely so you can add new records by entering data into this bottom blank row in your portal.
I'm sorry Phil, I did try your suggestion but am not quite sure I followed what you were saying correctly. Steve sent an example which was much easier to follow but didn't work correctly anyway because it didn't really match my scenario. So it ended up being a cross between the two. As for the duplicate records, no, I am not getting confused with the blank row in the portal for that line is coded to prompt the user to add a new record. Furthermore, I checked the table and took the script through debug so confirm two records are definitely being created.
If I understand this correctly...
Your layout specifies "Appraisal" in Layout Setup | Show Records from.
Your portal set up specifies "Appraisal Documentation" for the portal where you want your mouse click to show details about the record in that portal row.
And the container field shown in the center of your layout is a field from Appraisal Docs | Selected.
If so, then the script shown does not seem at all correct as the script would be:
Set Field [Appraisal::Appraisal Doc Relate ; Appraisal Documentation::_Appraisal Image ID ]
Note that no portal is needed for this container field. It can just be the container field selected from the Appraisal Docs | Selected table occurrence. (in the dialog where you select the field to add to the layout, select this name from the drop down at the top before selecting the container field to add to the layout.
BTW, is there a way to copy script and paste externally?
If you mean in order to post a script here as text:
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 New 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. (with this approach, you can get multiple script steps on the same line, please edit the pasted text by inserting some returns to separate those steps.)
- 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.
Thanks Phil, I had to leave this for a day or so because I could not see the forest for the trees! All works perfectly now, appreciate your help. S.