Welcome to the nuBuilder Forums!

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

Display Object Issue

Questions related to using nuBuilder Forte.
Locked
tonyd
Posts: 68
Joined: Sun Mar 04, 2018 6:38 pm

Display Object Issue

Unread post 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?
TonyD
admin
Site Admin
Posts: 2814
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: Display Object Issue

Unread post by admin »

TonyD,

Can you show a screenshot of what you mean?

Steven
toms
Posts: 785
Joined: Sun Oct 14, 2018 11:25 am

Re: Display Object Issue

Unread post 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
You do not have the required permissions to view the files attached to this post.
tonyd
Posts: 68
Joined: Sun Mar 04, 2018 6:38 pm

Re: Display Object Issue

Unread post 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.
TonyD
admin
Site Admin
Posts: 2814
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: Display Object Issue

Unread post by admin »

TonyD,

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

Steven
tonyd
Posts: 68
Joined: Sun Mar 04, 2018 6:38 pm

Re: Display Object Issue

Unread post 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
You do not have the required permissions to view the files attached to this post.
TonyD
tonyd
Posts: 68
Joined: Sun Mar 04, 2018 6:38 pm

Re: Display Object Issue

Unread post 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"?
You do not have the required permissions to view the files attached to this post.
TonyD
admin
Site Admin
Posts: 2814
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: Display Object Issue

Unread post by admin »

TonyD,

Try using #RECORD_ID# instead of #record_id#.

Steven
tonyd
Posts: 68
Joined: Sun Mar 04, 2018 6:38 pm

Re: Display Object Issue

Unread post 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#.
TonyD
admin
Site Admin
Posts: 2814
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: Display Object Issue

Unread post by admin »

.
Locked