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 

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

Thank Shiva, it working.

Can you please help me where I have to find this 'Add' button. This is not there in List control.

I need to hide this button also.

 

1000260683.jpg

Thanks, it is working.

Can you please help me to where I have to find this 'Add' button. It is not there in List control. I need to hide this button also.

 

1000260683.jpg

Hi @J Siva , Thanks It is working.

Can you please help me where i have to find this 'Add' button, it is not there in List Control,
Can you please help me where i have to find and restrict the button.

image.jpg