All records in all tables should have a unique primary key field. Have the button in the portal row run a script which:
• Sets a Variable to that row's record's primary key
• switch to a layout for that related table
• enter Find mode
• set the primary key field value the the variable
• perform the Find
This should get you to the one correct record.
Thank you. What does this mean:
"set the primary key field value the the variable"
This is the very step I am having trouble with.
It looks like that portal is on the faculty layout, displaying records from a Nominations table. The Nominations table most likely has a _pk_nomination field.
You don't need to worry about the pk of the Faculty table at all in what you're trying to accomplish.
Modify your script to be something like:
Set Variable [$idNomination; Value: Nominations::_pk_nomination]
Enter Find Mode
Go to Layout ["Nominations" (Nominations)]
Set Field [Nominations::_pk_Nomination; $idNomination]
View As [View as Form]
Since _pk_Nomination should be unique, that's all you need to look for.
By entering Find mode before going to the Nominations layout, your solution won't have to actually read any data that it doesn't need. Also, by adding the Freeze Window, again, you'll be minimizing some of the data transfer that will take place.
Use the script step
then use its calculation dialog to pick the primary key field of the portal table record as the value.
I'm really new and really slow. How do I find the:
primary key field of the portal table record
In Layout Mode, you'll see the name of the Table Occurrence that the portal is based on. Let's say its "Nominations". You can then go into the data structure using Manage Database. First look for a data table named Nominations. In that you'll see a list of all of the fields. Because I see that the Primary Key field in Faculty is using the naming convention of "_pk_Faculty", I assume that the same naming convention would have been used for the Nominations table. Look for something with "_pk_". If you find it...that's most likely the primary key field.
Hope that helps. Send a screenshot of the table in question. That might help, too.
The only PK/FKs I have set up are:
I know this can't be that hard but it is frustrating me enormously, nonetheless.
In Layout Mode, double click on the portal. At the top of the dialog box, it will say, "Show records from:", and it'll list the table occurrence you're looking for. Maybe I've been wrong in assuming it was nominations...and it's actually Awards.
So let's say you're displaying records from "Award". Then the _pk_Award is the field you're looking for.
Double-clicked on portal. It reads "show related records from nominations." But I don't have either PK or FK Nominations set up.
The only PK/FKs I have set up are:
Did we forget Go To Related Record in this discussion?
In a portal, a button can perform the GTRR step and either open a window or change layouts to show a detail view of the record clicked
This takes exactly one script step. Please note that this produces a found set of all the portal records, but makes the record clicked the current record, so in a form view layout, you see a detail view of just the record clicked in the portal row.
GTRR was tried by the original poster, but what was desired was a found set of only the one record clicked on in the portal.
then I typically set a global with the id of that related record. then GTRR based on the global and the line item. I may have another "portal" (on row) for the details of that one related record.
I believe there is an example here in Resources:
You can also follow up on the GTRR with a find matching records step on a field in the table that has unique values--such as a field with an auto-entered serial number.
The end result now is accomplished with two steps. (And find matching is better than show all-omit-show omitted in hosted solutions. )