Welcome to the nuBuilder Forums!

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

Problem with Display field working in Browse, but not in Edit

Questions related to using nuBuilder Forte.
Post Reply
camti
Posts: 12
Joined: Thu May 11, 2023 12:36 pm
Has thanked: 4 times
Been thanked: 2 times

Problem with Display field working in Browse, but not in Edit

Unread post by camti »

Hello,
I have a problem with a Display field:
In the Browse view it shows up exactly as expected, using this statement

Code: Select all

CONCAT (pro_short_name,'-#',pma_serial_nr)
Whereas in the Edit view, the field remains blank...

Any hints anyone how to fix this?
kev1n
nuBuilder Team
Posts: 4292
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 444 times
Contact:

Re: Problem with Display field working in Browse, but not in Edit

Unread post by kev1n »

Hi,

In the Display object, please ensure that you provide a complete and fully qualified SQL statement, such as

Code: Select all

SELECT CONCAT (pro_short_name,'-#',pma_serial_nr) FROM your_table
camti
Posts: 12
Joined: Thu May 11, 2023 12:36 pm
Has thanked: 4 times
Been thanked: 2 times

Re: Problem with Display field working in Browse, but not in Edit

Unread post by camti »

As you suggested, I have added the table to the statement, but this did not give the result expected, the field is unchanged and still empty.

Here is how I have amended the SQL in the Display tab of the Display field in question, but there must still be some error which I don't see...:

Code: Select all

CONCAT (tab_product.pro_short_name,'-#',tab_product_manuf.pma_serial_nr)

FROM
    tab_product_manuf
        JOIN tab_product ON tab_product.tab_product_id = tab_product_manuf.tab_product_manuf_id
In the Browse section of the corresponding form, I have those statements, which yield the expected results:

Code: Select all

CONCAT (pro_short_name,'-#',pma_serial_nr)
,

and in the SQL section this

Code: Select all

SELECT
 tab_product.pro_short_name,
    tab_product.pro_long_name,
    tab_product.pro_order_nr,
    tab_product_manuf.pma_serial_nr,
    tab_product_manuf.pma_product_id,
    tab_product_manuf.pma_jointid,
    tab_product_manuf.pma_customer_id,
    tab_customer.cus_name_official,
    tab_customer.cus_name_internal

FROM
    tab_product
        JOIN tab_product_manuf ON tab_product_manuf.pma_product_id = tab_product.tab_product_id
        JOIN tab_customer ON tab_customer.tab_customer_id = tab_product_manuf.pma_customer_id
Could you see why the expected result is displayed in the Browse View, and not in the Edit View?
Thanks in advance!

PS: in the ID field of the Object properties, I have written a "fantasy name", which I assume is okay, right?
kev1n
nuBuilder Team
Posts: 4292
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 444 times
Contact:

Re: Problem with Display field working in Browse, but not in Edit

Unread post by kev1n »

Presumably, you want to display the data of the current record?
In that case, you still need to specify a restriction on the record.

e.g.

Code: Select all

WHERE your_primary_key_column = '#RECORD_ID#'
If you do not obtain the expected results, it is advisable to execute the query using a tool like phpMyAdmin. This will allow you to verify if the output meets your requirements. Remember to substitute '#RECORD_ID#' with the actual ID of the record you are targeting.
PS: in the ID field of the Object properties, I have written a "fantasy name", which I assume is okay, right?
Yes, you can do that.
Post Reply