Page 1 of 1

Display Object Issue

Posted: Sat Apr 07, 2018 2:13 pm
by tonyd
My Edit form will not show the value of a Display object unless I "arrange" one of the form's objects. For example, if I simply select a row from the Browse form, the Display object on the Edit form shows nothing. But if I then rearrange one of the Edit form's objects using ctrl-shft-a, the Display object now correctly shows the value returned by the underlying SQL statement.

Any ideas?

Re: Display Object Issue

Posted: Sun Apr 08, 2018 1:08 am
by admin
TonyD,

Can you show a screenshot of what you mean?

Steven

Re: Display Object Issue

Posted: Sun Apr 08, 2018 10:06 am
by toms
It works just fine for me on an Edit Form.
display1.png
SQL query:

Code: Select all

SELECT COUNT(*) FROM zzzzsys_debug
Output:
output.png

Re: Display Object Issue

Posted: Sun Apr 08, 2018 5:33 pm
by tonyd
toms wrote:It works just fine for me on an Edit Form.
That would suggest that I induced the problem somewhere. In order to troubleshoot further, I need to know the difference between how nuBuilder draws an Edit Form upon selecting a record on a Browse Form and how it redraws the same Edit Form after saving changes made on the modal Arrange Objects window?

Thanks.

Re: Display Object Issue

Posted: Mon Apr 09, 2018 1:35 am
by admin
TonyD,

You need to give us more information - like toms did above.

Steven

Re: Display Object Issue

Posted: Mon Apr 09, 2018 2:53 am
by tonyd
display.jpg

Code: Select all

SELECT sum(total) AS total_due FROM (SELECT
    IF(
        Transactions.duration_type = 0,
        Transactions.duration / 60 * IF(Matters.billing_type = 0, Matters.billing_amount, 0),
        Transactions.duration * IF(Matters.billing_type = 0, Matters.billing_amount, 0)
    ) AS total
FROM
    Transactions
LEFT JOIN Matters ON Transactions.Matters_id = Matters.Matters_id
WHERE
    (
        (
            Transactions.Matters_id = '#record_id#'
        ) AND(Transactions.is_billable = TRUE)
    )
UNION
SELECT
    Expenses.expense_qty * Expenses.expense_amount AS total
FROM
    Expenses
WHERE
    (
        (
            Expenses.matterid = '#record_id#'
        )
    )
UNION
SELECT
    Payments.Payments_amount * -1 AS total
FROM
    Payments
WHERE
    (
        (
            Payments.Payments_matters_id = '#record_id#'
        )
    )) AS tmp_tbl
output1.jpg
Then, after saving from "Arrange Objects" (without actually arranging anything), a value shows up
output2.jpg

Re: Display Object Issue

Posted: Mon Apr 09, 2018 3:15 am
by tonyd
I created a test object
display2.jpg
with a simple query

Code: Select all

SELECT count(Matters.Matters_id) FROM  Matters WHERE 1
and I get the correct value
output3.jpg
Which would suggest that I have a query problem. But why would it work after saving from "Arrange Objects"?

Re: Display Object Issue

Posted: Mon Apr 09, 2018 3:39 am
by admin
TonyD,

Try using #RECORD_ID# instead of #record_id#.

Steven

Re: Display Object Issue

Posted: Mon Apr 09, 2018 1:41 pm
by tonyd
admin wrote:TonyD,

Try using #RECORD_ID# instead of #record_id#.

Steven
Hurray! That fixed it! Thanks Steven. Turns out there is a #record_id# Hash Cookie, but its value is not always updated like #RECORD_ID#.

Re: Display Object Issue

Posted: Mon Apr 09, 2018 5:30 pm
by admin
.