How to limit the returned rows of an interactive reports based on user role
Hello,
I am a new Apex-PL/SQL developer looking for some recommendations on how to implement an interactive report that needs to display different rows based on your current application ROLE.
Let's say for instance that you have an application for orders and 2 different roles: super-user and sales-rep
Now, if the super user logs in to the application, he should be able to see all of the rows in the orders table, however, if the user 'john' logs in with the role sales-rep, he should only see those orders assigned to him.
I dont think that I can use "dynamic" sql and build my where clause on the fly if I choose an interactive report so I was looking around and came across the concept of a piped function but it looks like some other people may be doing this with APEX collections. Is there anyone with some recommendation as to which one to use? Some books that I've been reading recommend putting most of the logic you can on your database (easier to maintain long term) which is why I was thinking on using pipep functions but I thought I would check with the experts first.
Thanks !