Prevent editing the fields via List Editor (cell edit) only when the Type is Standard

vivek11
Tera Contributor

Hi Team,

I need script for OnCellEdit client script for below requirement as i dont want to Write ACL for it due to some issues.


Prevent editing the following fields via List Editor (cell edit) only when the Type is Standard:

description

implementation_plan

test_plan (aka "Test and Validation Plans")

backout_plan

Can Someone please help me thanks in Advanced

1 ACCEPTED SOLUTION

@vivek11 

I already shared another option i.e. use before update business rule

But remember this will impact and stop user from saving when fields get updated from form as well.

Any reason not to use list_edit ACL?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

13 REPLIES 13

@vivek11 

I already shared another option i.e. use before update business rule

But remember this will impact and stop user from saving when fields get updated from form as well.

Any reason not to use list_edit ACL?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@vivek11 

You can try this

1) use GlideAjax from that onCell edit and pass the record sysId and newValue (both are available in onCell edit client script)

2) then in script include query your table with that sysId and check what's the type and return that type to onCell edit

a) if type = Standard and newValue and oldValue are different it means field was changed, so stop the edit

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Viraj Hudlikar
Tera Sage

Hello @vivek11 

 

Do check this thread Solved: Can someone help me with CellEdit client script ..... - ServiceNow Community

Do check this video - https://youtu.be/OQZX1JIVwW0?si=lFGKpczMjeBTblCq

 

If my response has helped you hit helpful button and if your concern is solved do mark my response as correct.

 

Thanks & Regards
Viraj Hudlikar.

Hi @Viraj Hudlikar 
I have gone through your videos.. I am not able to get my answer as i need access other field value in onCell edit client script based on this I need to make change record fields Read only..
If possible please provide me code..
Thank you in Advanced