I’m trying to create a RLS rule so that some users can view only some records in Inventory Transactions (InventTransItem) form. The rule includes inventory dimensions (users are allowed to view transactions concerning items ONLY within selected warehouses) and therefore I added a condition to the “warehouse” field on the “inventory dimensions” table in the query refering to Inventory Transactions table in RLS. The problem is - it doesn’t work. The condition is there, but the form still shows all the records, not only those within certain warehouse dimension. It looks like the conditions work only if the fields defining the condition are those within the top-level table and not those connected by relations. Does anybody know why is this happening?
It wont work if u create query on inventory dimensions. u have to create a query on inventory transactions table but u dont find any warehouse field in that transactions table.
its better to add a warehouse field in inventory transactions table then it will be easy to get.
The thing is - I DID create a query on inventory transactions (i added the inventory dimensions table in the query through a 1:n relation) and then I added the “warehouse” dimension. It doesn’t work. The added condition doesn’t effect the Inventory Transactions form. Currently I’m wondering if there is any way to MAKE it work.
The idea to add the warehouse field to inventory transactions table came through my mind, but that is the final thing I want to try, because the problem doesn’t only concern inventory transactions but also on-hand items. Therefore, everytime I would change a warehouse on an inventory dimension, it would have to update itself to every “added” warehouse field that I create. So, as you can see, this is not an optimal solution.
Ok, I found the solution. The related tables on the RLS query don’t work - that’s for sure, you have to aim for the table you are trying to limit in the main RLS tree. The thing is - the table list in RLS show labels (!) of the tables and not their actual names, that’s why there are some tables that have the same name in the RLS table tree. What I did wrong is select the Inventory Dimensions table on the Inventory Management module (InterCompanyInventDim) instead of the one in the Basic module (InventDim). When I changed that, the rest worked just fine.