How to limit the user create more than one ro...

(dev bc) #1

How to limit the user create more than one row data? The “New Create” should hidden.

(Neil Boisen) #2

My thought would be to add a condition to the NEW (system) Action for that Related Accounts table with a formula such as COUNT(FILTER(Related Accounts Table, [MainID] = MainTable[ID]) = 0

Haven’t tested the function, but I hope you get the idea.

(Suvrutt Gurjar) #3

Hi @dev_bc

You may wish to create a update / read only ( no add ) slice of the Accounts table and use that slice in referencing.

(Neil Boisen) #4

@Suvrutt_Gurjar

IT would seem that would work if you don’t want to users to add ANY accounts. But if you want to allow them to add just ONE account, that wouldn’t be sufficient.

(Suvrutt Gurjar) #5

Hi @Neil_Boisen

You are right. Somehow I missed that one record criteria.

(Suvrutt Gurjar) #6

@dev_bc I request to try something like COUNT([_This])<=1 in the valid_If parameter

of the reverse reference list type column. I also could not

test this but hope it helps.

This will not remove the " new record" sign but will not allow addition of more than one record.

(Neil Boisen) #7

You can HIDE the “Add” button by putting a condition in the NEW or ADD ACTION associated with the sub-table.

This will be a system generated Action, so you need to click “show system actions”.

Then add a condition that does not allow the row count to be greater than 1 for rows where the Ref ID = Main table ID.

When the condition is met, the button will disappear.

(dev bc) #8

Dear @Neil_Boisen, the formula doesn’t work. If you have simple example to demonstrate the formula that’s good for me to understand it.

Dear @Suvrutt_Gurjar, Ya, your formula is work. Thanks. Is it possible to remove the “New Create” button?

(Aleksi Alkio) #9

You need to create another virtual REFROWS column and use it with the slice. Choose read_only for the slice. Then with suitable formula in the Show_If, you can control which virtual column you want to show.