I’ve spent time looking through the forum and I’ve seen similar questions and answers but I can’t seem to find the answer that directly addresses my issue. I’m a beginner, so apologies if I’m repeating something that’s already been raised and resolved.
I’m building a multi-tenanted app (one app serves multiple clients). All data tables include a relationship to a “Company table” in order to filter records when displaying, adding and editing.
When I create an “Add Record” screen I need the new record to be updated with the appropriate Company relationship. I know I can set a Table Rule to automatically populate the record with Company on “Save”, however the live form needs a Company selected as reference to be able to filter all other select fields in the form that belong to that Company – e.g. employees, assets, etc. (“Show” – “Show Assets (using the Company field) that are connected to this form’s Company”)
The only way I’ve found that works so far is to include a “Company” select option and filter this field to “Limit to Company Logged-in User is connected to… Users>Company”. This provides a Company select drop-down that only offers the User’s Company to select and all other select fields show only records for that Company.
I’d like to have the Company pre-populated, so the User doesn’t need (or even better) see this option.
Is there a way to pre-fill this select option, or to somehow select the appropriate Company for the form behind the scenes?
Have I missed a function, or is there a better way to set up my databases that will work?