list edit

Shreshta_happy
Tera Contributor

I have written few client scripts and BRs on the form view for two fields ,

in which one field is read only integer(count) and the other is choice (reviewer),so depending upon the state field the reviewer and the count values will change.

for one state value the reviewer should be read only and this is working as expected in form view , but is not working on the list view.

 

 

ON FORM VIEW:

Shreshta_happy_0-1668771294847.png

ON LIST VIEW:

Shreshta_happy_1-1668771350981.png

 

in form view it is read only and list it is editable, please help me with the code .

 

 

 

1 ACCEPTED SOLUTION

OlaN
Giga Sage
Giga Sage

Hi,

Like mentioned by a couple of others before, a Client script only runs on the form view, not in the list view.

 

You can create a list edit ACL, that prevents users from editing the field in the list (example below).

Another option is to create a business rule that prevents users to save the record in the circumstances you mentioned (when the field should not be edited in the list).

But creating such a BR will not help with the issue that the field looks like it's editable in the list, the user can try to set the value, and will then receive an error message.
If you need the field to be read only, you will need to add the ACL record.

 

listedit-acl-example.png

View solution in original post

11 REPLIES 11

Hi @Shreshta_happy 

Keep your client script as it is to set the value for field and then also create an ACL to make the field read only. In that way you can set default value as well.


Please Mark My Response as Correct/Helpful based on Impact
Regards,
Gunjan Kiratkar
2X ServiceNow MVP
Community Rising Star 2022
Youtube : ServiceNow Guy

OlaN
Giga Sage
Giga Sage

Hi,

Like mentioned by a couple of others before, a Client script only runs on the form view, not in the list view.

 

You can create a list edit ACL, that prevents users from editing the field in the list (example below).

Another option is to create a business rule that prevents users to save the record in the circumstances you mentioned (when the field should not be edited in the list).

But creating such a BR will not help with the issue that the field looks like it's editable in the list, the user can try to set the value, and will then receive an error message.
If you need the field to be read only, you will need to add the ACL record.

 

listedit-acl-example.png