Restricting record visibility in contract table?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2023 02:17 AM
HI All,
I have a requirement, In contract table for example 5 users have access to that table. If two users raise the contract request other 3 users can't able to see there records. We need to block all ways to restrict there records. Please help me on this.
Thanks,
Karishma

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2023 02:29 AM
Hi,
Your question is a bit confusing, could you elaborate a bit more?
In general, if all 5 users have access to the table, and all the records within, you cannot create additional access controls that restrict access to a subset of these records, because access is already granted.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2023 02:30 AM - edited 11-03-2023 02:43 AM
Hi @karishma shaik ,
You can create new read acl on table level for contract table with below script
if(gs.getUserID() == current.sys_created_by){
answer = true;
}else{
answer=false;
}
or you can create before query business rule on contract table
(function executeRule(current, previous /*null when async*/ ) {
current.addQuery('sys_created_by', gs.getUserID());
})(current, previous);
1. Performance: Before query is better because the conditions/filters run the initial Database query level.
2. User Experience: Before Query is better because you don't get the security message in the bottom of the ListView saying 'some records removed due to security" which might confuse the user.
Though ACL has its own advantages (for example - field level restriction..etc)
Please mark it as solution proposed and helpful if its serves your purpose.
Thanks,
Anand
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2023 02:32 AM - edited 11-03-2023 02:32 AM
Hello @karishma shaik ,
Write a query Business rule on the contract table and return a query like below :
current.addQuery('created_by', gs.getUserID());
So that, records that records created by current logged in user will only be shown.
Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks,
Venkatesh Nekkanti