- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a month ago
Hi,
We want to implement a database view for below requirement:
Active users in active groups that has a role, preferable not inherited ones.
When database view is created for this, it shows inactive users too. Created a database view with on user table with just active = true condition, it it still showing all the records. Can you anyone please assist?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a month ago
Database views are meant to join two or more tables. It is possible to self-join which is useful in some cases, but that's not what you want to do here. This will get you started on showing active users in active groups, joined with the user role table
If you grant roles to groups you'll want to include the sys_group_has_role table instead or also.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a month ago
Hi there @sath
Database view filters (the “Where clause” in your screenshot) are not enforced at runtime when querying the view. They only help optimize the view when joining large tables, but do not act as actual filters for the output. try to If you're using the view in a report/UI, consider adding a calculated/flag field or writing a scripted view that only includes the logic you want (active users + active groups + role checks).
If this helps kindly accept the solution thanks.
Kind Regards,
Mohamed Azarudeen Z
Developer @ KPMG
Microsoft MVP (AI Services), India
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a month ago
Database views are meant to join two or more tables. It is possible to self-join which is useful in some cases, but that's not what you want to do here. This will get you started on showing active users in active groups, joined with the user role table
If you grant roles to groups you'll want to include the sys_group_has_role table instead or also.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
@Brad Bowman Thank you!