I have a form for my “Stock In” table, that has a reference to my “Medication” table.
I only want to allow users to add a row to the Medication table using the Medication form.
When a user adds a new “Stock In” item via the form, the Medication field is a modal that lists the Medications as well as a “New” option. I want to disable the “New” option from the “Stock In” form.
I’ve tried adding a switch to the “Are updates allowed?” expression of the Medication table, like so
SWITCH(CONTEXT("Table"),
"Medication", "ADDS_ONLY",
"READ_ONLY")
Seems like that should work wonderfully but that hides the + button on the Medication primary view.
Why doesn’t that work?
I’ve also tried switching on Context(“View”) but no luck there either. It displays the + button on the Medication view but then when I click it I get an error “Table Medication does not allow new entries” because the view has changed to be the form (which I noticed doesn’t have a View param in the URL).
Any other ideas for disabling additions from the reference modal?



