1 of 1 people found this helpful
You should find a number of working examples in this forum as this is not the first time it's been requested.
One way is to set up a "self join" that links two occurrences of the same table in a Cartesian join:
LayoutTO::anyNeverEmptyField X PortalTO::anyNeverEmptyField.
A portal to PortalTO will list all records in that TO's table on your layout. Add filtering capability via portal filter expressions and the left side is done.
Then make the fieldoe row of fields in the portal row into a button, or add a button to the portal row to perform this script:
Set Variable [$SelectedRecordID ; PortalTO::__pkTableNameHereID ]
Enter FInd Mode [ pause: no ]
Set Field [LayoutTO::__pkTableNameHereID ; $SelectedRecordID ]
Perform Find [ ]
That's all that's needed, though Go To Related Record could also be used here.
Thanks! I was unaware of the idea of self-joining tables.
Some minor clarification questions:
- Can the "anyNeverEmptyField" just be the primary key (as this will never be empty)? Or is there a reason to select a field other than the primary key?
- In your script, is there a reason to set a variable? Can you not just use "Set Field [LayoutTO::__pkTableNameHereID; PortalTO::__pkTableNameHereID]?
Thanks again for pointing me in the right direction!
- It pretty much can be any field. And the field, to correct myself, does not even have to be empty. You can even define a field to use for this, add the relationship and then delete the match fields and the Cartesian join still works. A primarykey field can certainly be used, just keep in mind that the field's actual value is not used to match record in this relationship.
- You need the variable if you are going to perform a find. Watch what happens to fields when you enter find mode, they become blank so you have to copy the value into a variable (a field with global storage could also be used.), so that the value doesn't disappear on you when the window enters find mode.