Make ready only

siddharth26
Tera Guru

Hi All,

 

I have a cab meeting form as shown below table is cab_meeting

siddharth26_0-1726814142984.png

 

under this form in the related list i have Cab Agenda as shown below.

 

siddharth26_1-1726814222767.png

 

when i open any one if the cab agenda item as shown below.

siddharth26_2-1726814291150.png

 

when i open this record i want all this fields to be editable only for CAB managers and Delegates as show in the first screen shot .

let me paste that screen shot to whom it should be editable 

 

siddharth26_3-1726814424610.png

in this case the cab agenda item should be only editable for christen, and Eric and fred for rest all of them it should be read only.

 

could you please suggest how can we achieve this.

 

thanks

sid

 

 

 

2 REPLIES 2

SP22
Mega Sage
Mega Sage

Hello @siddharth26,

We can use Onload client script or ACL (field level - WRITE) to make fields editable/readonly.

function onLoad() {
   //Type appropriate comment here, and begin script below
  if( g_user.hasRole('admin'))
	  {
		  g_form.setReadOnly('fieldname',false);
	  }
	else
		{
			g_form.setReadOnly('fieldname',true);
		}
}


Thanks
SP.

Long Duong
Kilo Sage

Hi @siddharth26 

Hope you are well!

 

To restrict write access for other people, you can use the ACL to do it by following steps:

- Create ACL "write" operation on the "CAB meeting" (cab_meeting) table at the "none"

LongDuong_0-1726823797505.png

- Add the condition like the following image

LongDuong_1-1726823839904.png


You also need to de-active all other ACL at that table following the link https://your_instance.service-now.com/sys_security_acl_list.do?sysparm_query=operation.nameSTARTSWIT...

 

Please accept my solution and mark it helpful if it can help you.

Thank you!