State is closed All fields readonly

katakam sravan1
Kilo Explorer

State is closed All fields readonly

6 REPLIES 6

Anurag Tripathi
Mega Patron
Mega Patron

Hi,

You have to create an ACL on the table in question, It should be something like this

 

Type : Record

Operation: Write

<your table>.*

Condition: State IS Closed

script : answer = false

-Anurag

-Anurag

Musab Rasheed
Tera Sage
Tera Sage

Hello,

Write on load client script like below, Exclude admins because In case you need modification then you can ask admins to do that.

function onLoad() {
	if(!g_user.hasRole("admin") && g_form.getValue("state")==7) {
	 var fields = g_form.getEditableFields();
         for (var x = 0; x < fields.length; x++) {
           g_form.setReadOnly(fields[x], true);
         }
	}
}

Please hit like and mark my response as correct if that helps

Regards

Please hit like and mark my response as correct if that helps
Regards,
Musab

hey Mate, just to add a bit, this will still leave the fields open in list view.

-Anurag

Ahh agreed, Thanks for correcting me.

Please hit like and mark my response as correct if that helps
Regards,
Musab