Prevent users from Adding records to a related table via a Detail form

I have an app that links multiple tables together. One of the links is a parent DaySheets table linked to a Labour table as the child.  The Labour table has a Ref field link to the DaySheets table via [DaySheet Id] and I made it is a required field because I don't want any entries in the child table without a matching parent. 

Another link in the table links the Worker table to the Labour table and I want the workers to be able to look up related Labours. However the form automatically offers them the View  and Add options,  I tried preventing the ability to add by not making the required [DaySheet Id] field visible, however when they use the Add option they can still add a labour without a related DaySheet id. 

What's the easiest way to allow them to View Related Labours but not have the ability to Add them via that form. They need to find the Day sheet and add labours via the day sheet.

GriffAdmin_1-1677727397052.png

 

Solved Solved
0 3 228
1 ACCEPTED SOLUTION

Please try below.

Please create a read only slice on the Labour table called say "Labour Slice View"

Then create a VC called say [Related Labour View] in the Workers table with an expression something like 

REF_ROWS("Labour Slice View", 'Worker Table key") 

Please make show_if of this column to only workers email IDs ( and may be admin emails or managers emails).

Please enter the slice name "Labour Slice View" in the referenced table name. Both these settings are highlighted below.

Suvrutt_Gurjar_0-1677728480294.png

 

There will also be a system generated ID reverse reference column in the Workers table called something like [Related Labours]. In this column's show_if, please add only those email IDs ( admin, manager etc) whom you want to allow to edit the labour records.

View solution in original post

3 REPLIES 3

Please try below.

Please create a read only slice on the Labour table called say "Labour Slice View"

Then create a VC called say [Related Labour View] in the Workers table with an expression something like 

REF_ROWS("Labour Slice View", 'Worker Table key") 

Please make show_if of this column to only workers email IDs ( and may be admin emails or managers emails).

Please enter the slice name "Labour Slice View" in the referenced table name. Both these settings are highlighted below.

Suvrutt_Gurjar_0-1677728480294.png

 

There will also be a system generated ID reverse reference column in the Workers table called something like [Related Labours]. In this column's show_if, please add only those email IDs ( admin, manager etc) whom you want to allow to edit the labour records.

Absolutely brilliant! Worked perfectly. I chose not to allow anyone to edit records this way (didn't use the ShowIf option you suggested) because I didn't want to risk allowing even administrators to change the labour hours if the day sheet was closed, and the order possibly already invoiced.

Thank you for the update. Good to know it works as desired. Please test well for all edge cases for access control as it seems to be a critical functionality of labour hours.

Top Labels in this Space