- 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 07:20 AM
The best option would be restricting the users from being able to edit the field from the list view. I have searched for potential solutions but was left with this.
Please like or mark correct based on the impact of the response.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-31-2017 07:25 AM
Siddartha, the use case clearly mentions that they want end users with certain roles to perform the activity on list view and they should not see all the values which is there in the choice list.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-31-2017 07:22 AM
There is a client script type onCellEdit. You could try using the same "remove" logic in that as your onLoad script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-31-2017 07:49 AM