- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-17-2023 07:58 AM - edited ‎10-17-2023 08:04 AM
Hello Experts,
I have two custom fields on form for allowed users and allowed groups, I have written before query business rule to restrict the access, but the condition which I've applied is not working for all users.
Could anyone please figure out where I'm getting wrong here?
Business rule -Type: Before, Query
condition:
Code:
As per the requirement, the system should check either user is present on allowed users field or he is part of the group present in allowed groups field.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-17-2023 08:17 AM
Your IF condition doesn't seems correct, the brackets ")"closing are more then "(" the openings.
Check your condition.
Raghav
MVP 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-17-2023 08:17 AM
Your IF condition doesn't seems correct, the brackets ")"closing are more then "(" the openings.
Check your condition.
Raghav
MVP 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-17-2023 09:03 AM
if ((!gs.hasRole('admin') && gs.getSession().isInteractive()) || (gs.getUserID().isMemberOf(current.u_allowed_groups.toString()) && gs.getSession().isInteractive()))
Can you try using getUser() instead of getUserID(), this should correct your code working.
Best regards
Suyog