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

Saurav11
Kilo Patron
Kilo Patron

Hello,

 

Client script only works on form view.

 

To make the field non-editable on both form view and list view you probably should use either ACL or Data policy

 

Please mark my answer as correct based on Impact.

Hello,

 

In ACL as well you can write the script on when you want to make the field readonly or not based on the value

 

Below is an example:-

Saurav11_0-1668774235304.png

 

So answer=true means you want it to be editable and answer=false means you want it to be non editable

 

Please mark my answer as correct based on Impact.

hello,

 

Please share your current script so that we can modify it according to ACL

RaghavSh
Kilo Patron

Client scripts will not work on list view unless it is an on Cell edit client script.

The best her would be to create an ACL on those fields , which will work on both form and list view. In that case you will not need separate client script for from.


Raghav
MVP 2023