Page 1 of 1
Adding relation to browse shows no records
Posted: Mon Sep 07, 2020 8:28 pm
by treed
Hello I'm trying to make a browse screen for a lookup for Organizations that have BinsOut. When the relation is added to the query for the browse screen no records appear. When the same query is run in MyPHPAdmin I get the expected result set. Here's some screen shots of what I'm seeing.
Selection_091.png
Data set that is returned by the query.
Selection_092.png
Query in NuBuilder
Selection_093.png
Blank form. If I go back into the query builder and delete the joined table I'm relating to the OrgID's populate the form as expected.
Am I doing something wrong here???
Re: Adding relation to browse shows no records
Posted: Mon Sep 07, 2020 8:42 pm
by gerese
What error occurs in "nuDebug Results"?
PS
Try to edit in second table column "OrgID" in "Org_ID"
Re: Adding relation to browse shows no records
Posted: Mon Sep 07, 2020 9:18 pm
by treed
Ah you're on the right track here. Looks like when nuBuilder creates the query it does not preface the field names with the table names as it shows in the query builder. This means every field name in the system needs to be unique. This will make it really tough to consistently use FK's in a large system.
Re: Adding relation to browse shows no records
Posted: Tue Sep 08, 2020 6:50 am
by kev1n
treed wrote: This means every field name in the system needs to be unique.
Not necessarily. You can write a SELECT .. FROM .. SELECT statement.
Code: Select all
SELECT * FROM (
SELECT
test.test_id,
test.field00,
test.field01,
test.field02
FROM
test
LEFT JOIN test2 ON test2.field00 = test.field00
) T
Re: Adding relation to browse shows no records
Posted: Tue Sep 08, 2020 6:00 pm
by treed
Thanks for the work around. I was thinking a bit about this last night and is nuBuilder coded this way to support hash cookies?
Re: Adding relation to browse shows no records
Posted: Tue Sep 08, 2020 6:04 pm
by kev1n
treed wrote:is nuBuilder coded this way to support hash cookies?
Yes, you can use Hash Cookies in the Browse SQL.
Or what exactly do you mean / what would you like to do?