- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-31-2017 07:17 AM
HI,
Use case: We have a choice list which has 5 values and i have given on load client script to remove option from the choice list depending upon roles. This is working fine on the form. But on the list view i am able to see all the choice values.
Is there a way we could hide the values on list view depending upon roles.
-Vignesh
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-30-2019 04:06 AM
I would suggest a new Client Script that runs onLoad.
function onLoad() {
//who to display it for - admin
var isAdmin = g_user.hasRole('admin');
if (!isAdmin){
g_form.removeOption('contact_type', 'integration');
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-31-2017 08:42 AM
Thanks again Chuck. What is the work around we can use for this use case.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-31-2017 08:51 AM
Hello Vignesh,
Did you get a chance to go through my initial response? Here are the options
- Prevent users from editing the choice field via a list_edit ACL
- Disable list editing for the list
- Create a business rule to prevent users from setting the choice values. Validation will be based on roles.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-31-2017 09:44 AM
Pradeep Sharma's Blog when i try this it will not allow me to select choice values, use case: is that it should allow hide few choices from the drop down on list view.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-31-2017 09:45 AM
Thanks Chuck, will try to convince the business and get some other alternate way.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-31-2017 10:50 AM
You are right. The options will prevent users updating the list view(BR aborting the record update per condition) but will not hide the list view.