Hide a variable on record producer based on role of logged in user 
						
					
					
				
			
		
	
			
	
	
	
	
	
- Mark as New
 - Bookmark
 - Subscribe
 - Mute
 - Subscribe to RSS Feed
 - Permalink
 - Report Inappropriate Content
 
09-30-2020 05:41 AM
Hi I have a field on record producer which is in customer service scope.
that field should only visible to user with role ' sn_customerservice.customer_admin'.
How do I achieve this?
- Labels:
 - 
						
							
		
			Incident Management
 
- Mark as New
 - Bookmark
 - Subscribe
 - Mute
 - Subscribe to RSS Feed
 - Permalink
 - Report Inappropriate Content
 
09-30-2020 05:47 AM
Hi,
Use Catalog Client Script for it
function onLoad() {
    if(!g_user.hasRole('sn_customerservice.customer_admin')){
        g_form.setVisible("field", false);
    }
}
- Mark as New
 - Bookmark
 - Subscribe
 - Mute
 - Subscribe to RSS Feed
 - Permalink
 - Report Inappropriate Content
 
09-30-2020 07:43 PM
somehow this is not working, it is giving access to everyone
- Mark as New
 - Bookmark
 - Subscribe
 - Mute
 - Subscribe to RSS Feed
 - Permalink
 - Report Inappropriate Content
 
10-01-2020 01:32 AM
- Mark as New
 - Bookmark
 - Subscribe
 - Mute
 - Subscribe to RSS Feed
 - Permalink
 - Report Inappropriate Content
 
09-30-2020 06:04 AM
Hi,
You can do this either by catalog UI policy /Catalog client script
You need to write below script if you are using catalog UI policy
function onCondition() {
 if(g_user.hasRole('sn_customerservice.customer_admin'))
 {
 g_form.setDisplay('u_field',true);
 
 }
}
Note: Make sure Reverse if False check box is true.
Thanks,
Pooja M
