LinkToFilteredView in App Conditional always chooses the false condition

I have an invoices application. The Invoice view shows a table of the Invoices, and each row contains a reference to the view of the items contained in that invoice. This reference is working as expected, however, I want to modify the reference view to be read-only if a value in the Invoice is set to Y.

I built two views on Invoice Items. The first view is a ref table view, based on Invoice Items source table, which allows Updates, Adds and Deletes. I named the view “Invoice_Item_Editable”. The second view is a ref table view, based on a read-only slice of the Invoice Items source table. I named this view “Invoice_Item_Uneditable”.

I would like to show the editable or read-only view, based on whether the parent Invoice row is “Locked”.

On the Invoice table, I have a Y/N value field and I also have an App (virtual) column with the following code:

IF([_THISROW].[invoice_locked_by_google_admin] = “N”, LINKTOFILTEREDVIEW(“Invoice_Item_Editable”, [invoice_invoice_id] = [_THISROW].[invoice_id]), LINKTOFILTEREDVIEW(“Invoice_Item_Uneditable”, [invoice_invoice_id] = [_THISROW].[invoice_id]))

At runtime, the Invoice view is presented, and the reference column appears as expected with the list-url image in each row. However, no matter if I pick a row with a Locked value of N or Y, the last view mentioned in the App virtual column code is always the view that is derived at runtime.

I’ve tried changing the condition from “N” to False, and I’ve tried reversing the logic to put “Y” or True first, but it makes no difference.

Is this a known bug, or am I going about this the wrong way?

Try changing this:

[_THISROW].[invoice_locked_by_google_admin] = “N”

to this:

[invoice_locked_by_google_admin] = “N”
1 Like

IF([invoice_locked_by_google_admin] = “N”, LINKTOFILTEREDVIEW(“Invoice_Item_Editable”, [invoice_invoice_id] = [_THISROW].[invoice_id]), LINKTOFILTEREDVIEW(“Invoice_Item_Uneditable”, [invoice_invoice_id] = [_THISROW].[invoice_id]))

This worked! Thank you!

It would be extra cool if I could also change the icon from list-url (editable) to alt-lock (uneditable). I don’t suppose that’s possible? Not a big deal, but it would cool.

2 Likes