Conditionally hide ADD button upon parent's table condition

Hi,

I have a parent table Header and child table Items. Header table has ID column, Items table has multiple rows with their own ID and also same HeaderID that links to the Header table.

The user is supposed to add items to the Item table as long as the column IsFinished in table Header is FALSE. I want to conditionally hide ADD button in table Items. I tried LOOKUP([_THISROW].[HeaderId], "Header", "Id", "IsFinished" = FALSE and LOOKUP([HeaderId], "Header", "Id", "IsFinished" = FALSE, but none of them works. If I try TEST from the expression window it works both time (returns TRUE for unfinished Headers and FALSE for finished Headers), but the ADD button is hidden in every situation. I think I will go crazy very soon...

What have I overlooked?

Many thanks,

Vaลกek

 

Solved Solved
0 5 258
1 ACCEPTED SOLUTION

You need to add an additional virtual column to your parent table with the REF_ROWS(). For that column, you need to add a slice but with a READ_ONLY or UPDATES_ONLY (but not ADDS_ONLY). Then depending on the status of your parent, you show the original or new virtual column. With this way you can hide the "Add" button because the slice doesn't allow adds.

View solution in original post

5 REPLIES 5

You need to add an additional virtual column to your parent table with the REF_ROWS(). For that column, you need to add a slice but with a READ_ONLY or UPDATES_ONLY (but not ADDS_ONLY). Then depending on the status of your parent, you show the original or new virtual column. With this way you can hide the "Add" button because the slice doesn't allow adds.

Thank you for a solution. I used it to move forward.

Is is some kind of workaround or just only solution? I wonder why the conditional hidding of Add button doesn't work. The expression works, it returns TRUE of FALSE depending od the right condition, but the Add button does not react according to the output TRUE/FALSE value.

Using a formula with that action button's doesn't work because you are trying to hide it with the inline view, but you are not on that view and the app doesn't understand it.

Ok, that makes sense. Thank you for your explentation.

You're welcome!

Top Labels in this Space