The portal will show all records in the portal only if your global field has all ID's listed.
If your global is blank...the portal shows the related records (ie. none).
You might consider a double portal (side by side) with the first showing all of the records (self join cartesian [X]) and the second the way you have it now.
Make the left one a "selector" portal, where choosing an item adds it to your global field...thus making it appear on the right one...
I understand what your saying eric ,but i have this working on another layout in this solution and when you enter the layout it displays all the records.
If it is working elsewhere, then your field content of global field must be OK...
Silliness check....is your portal based on Brewery_Name_Search and your layout in question based on Breweries?
Are the fields in your portal from Brewery_Name_Search?
Silly, but easy to miss...
Yes all of that checks out.
Put your global field on your layout and expand it, entirely outside the portal. What's in it?
If it is populated correctly...the issue is either in your relationship, or your portal elements.
If it is blank...look for the mechanism populating it on your other layout that works...
FWIW...your key fields in your two examples are not identical...check on those too...BreweryId vs. BreweryDBId
Both global fields arent in the portal they are outside of it . The fields are empty.
BreweryDBId vs BreweryID are two different ids. Sounds confusing but they are two different fields.
On the other layout, nothing is populating it. Some how it just works.
From what I see, your ExecuteSQL query has incorrect syntax. Don't see how it can return anything but a ? result indicating a syntax error.
ExecuteSQL (" SELECT TableOccurrenceName::FIeldName...
is not correct syntax for this function. It should be:
ExecuteSQL ( "SELECT FieldName FROM TableOccurrenceName...