Forum Discussion
tables relation issue
i have this db model :
for the customers table, the salesteam column is a calculated column taken from the salesteam table by using lookup(). i have made a rls rule with the userprincipalname() for the salesteam name. the problem is i have a page that uses the calculated column salesteam from the customers table, and it does not get filtered with the rls filter made on the accessteam table, and when i tried making a relation between the customers table and the salesteam table i got an error that the sales table has 2 paths to salesteam table, one from customers and one from salesperson.
what can i do to solve the issue?
3 Replies
- mh2587Super User
If removing the calculated column is not feasible, consider introducing a bridge table for SalesTeam to manage the RLS filtering:
- Create a bridge table that only holds SalesTeam values and connects Customer and SalesPerson.
- Establish relationships from both Customer and SalesPerson to the bridge table instead of directly linking Customer to SalesTeam.
- Apply your RLS on the bridge table to enforce filtering based on SalesTeam values.
- Hussein_charifHelper V
i got an error ambiguous paths, because sales is connected to customer and customer is connected to the bridge table, and sales is also connected to salesperson and salesperson is connected to the bridge table
- AnonymousNot applicable
Hi Hussein_charif ,
If possible, I would recommend considering a modification to your data model by using Customers as a bridge table between SalesPerson and Sales, and applying RLS rules on AccessTeam.
Best Reagrds,
Bof