Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

Lookup field in Browse and reports

Questions related to using nuBuilder Forte.
Post Reply
ivan
Posts: 8
Joined: Wed May 25, 2022 11:26 am
Been thanked: 1 time

Lookup field in Browse and reports

Unread post by ivan »

:hi: Hi I have created a lookup field that works OK in an edit form but in the browse form it just shows random numbers also this is the case in the report i created.

Can anyone assist please.
kev1n
nuBuilder Team
Posts: 4297
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 445 times
Contact:

Re: Lookup field in Browse and reports

Unread post by kev1n »

HI,

Hi, you will need to use a SQL JOIN in the Browse SQL to retrieve the description/name and display it instead of the id.
This "random number" is the primary key.

Check out https://github.com/nuBuilder/nuBuilder-4.5/issues/28
ivan
Posts: 8
Joined: Wed May 25, 2022 11:26 am
Been thanked: 1 time

Re: Lookup field in Browse and reports

Unread post by ivan »

Many thanks for your reply, unfortunately I still cant get it to work. I have noticed that id field and lookup field both only contain numbers and letters in the database. I did an export of the table which I hope I have attached.
Where you say do a JOIN to display the description I'm not sure what you mean.

Sorry but I am new to this so struggling a bit.
You do not have the required permissions to view the files attached to this post.
kev1n
nuBuilder Team
Posts: 4297
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 445 times
Contact:

Re: Lookup field in Browse and reports

Unread post by kev1n »

What does your Browse SQL Look like?
ivan
Posts: 8
Joined: Wed May 25, 2022 11:26 am
Been thanked: 1 time

Re: Lookup field in Browse and reports

Unread post by ivan »

Hope this is helpfull

SELECT
lookup_test.lookup_test_id,
lookup_test.lookup

FROM
lookup_test

LEFT JOIN mftr ON Lookup.lookup_test_id = Manufacturer
ivan
Posts: 8
Joined: Wed May 25, 2022 11:26 am
Been thanked: 1 time

Re: Lookup field in Browse and reports

Unread post by ivan »

When I put the join statement in, no records are displayed. I have tried varies ways but no joy.
Thank you for your help, don't want to be a pain.
kev1n
nuBuilder Team
Posts: 4297
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 445 times
Contact:

Re: Lookup field in Browse and reports

Unread post by kev1n »

Inspect the generated Browse SQL by pressing ctrl+shift+m and run it in phpMyAdmin. In this way it's easier to see where there is a mistake.
Post Reply