Access to records based on domain
Hi,
I am looking for some feedback on how I am looking at approaching this application,
- The application I have in mind deals with equipment that is sold by our distributor partners and that needs to be assigned to the end-user that purchased it. This would happen in the "Equipment Form"
- The application has the equipment serial number and the distributor who sold it. The distributor information is recorded in the "Distributor Form" and available in the "Equipment Form" via a lookup.
- From each distributor, multiple employees can register for the app - but should only see those records associated with their own company/distributor.
The way I was thinking of approaching this was to record the email domain of each distributor in the Distributor Form (ie @distributor-A, @distributor-B.com or @distributor-C.com and then provide access to records in the Equipment Report based "logged-in user email domain = distributor domain".
In other words - Bill at Distributor A has access to all Distributor A equipment records because Bill's email address (Bill@distributor-A.com) contains the distributor email domain (@distributor-A.com).
1. Is this the best way to approach it?
2. Would anyone have a code snippet to filter the report and to accomplish the above?
Thanks in advance
JV