Choice list to show depending upon Roles

Vignesh21
Kilo Guru

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

1 ACCEPTED SOLUTION

Henrik Jutterst
Tera Guru

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');
	}
}

View solution in original post

19 REPLIES 19

Thanks again Chuck.   What is the work around we can use for this use case.


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.

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.


Thanks Chuck, will try to convince the business and get some other alternate way.


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.