Hide Edit and New Button in the related list when state is Resolved and Closed for itil users

vennugopikr
Tera Contributor

Hi Sir,

At state is open, work in progress and pending state 'itil' users able to add and create the records in the related list..

 

But when the state is resolved and Closed 'Edit' and 'New' Buttons should be hide to the 'itil' users.

only it needs to be add and create access to 'Admin's.

Please suggest . In the List control what role's I have to give and what is script I have to written.

@Ankur Bawiskar 

1 ACCEPTED SOLUTION

J Siva
Tera Sage

Hi @vennugopikr 

Try the below script under "Omit New button condition" & "Omit Edit button condition".

if(parent.state == 6 || parent.state ==7){
	if(gs.getUser().hasRole('admin')){
		answer = false; // Show new button to the admin users
	}else{
		answer= true;
	}
}else{
	answer= false;
}

Regards,

Siva

 

Screenshot_20250727-064635.png

View solution in original post

5 REPLIES 5

J Siva
Tera Sage

Hi @vennugopikr 
Screenshot is not visible...