client script-set read only
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-23-2023 05:15 AM
Hi, I need to make a client script that will make the state button read only even on the fly. A new incident that I open will directly be read only and also when there is an incident form in the system and I want to change the status, so I can't. please me give client script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-23-2023 05:40 AM
No, I can't through dicanory, only through ui polocy or client script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-23-2023 05:42 AM
Any reason not to take Dictionary way?
UI Policy:
Write a UI Policy
Active = True or False
UI Action
State = Read Only
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-23-2023 05:42 AM
I did ui policy but it only works for me inside the form itself and not in the list I am attaching a picture where it doesn't work for me
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-23-2023 05:51 AM
Hi @yardenKrispel,
To disable the edit option in List view has two ways.
1. ACL
operation : write
incident.state
In script
answer = false;
2. On Cell edit Client script
function onCellEdit(sysIDs, table, oldValues, newValue, callback){
var saveAndClose = true;
if(newValue != oldValue){
saveAndClose = false;
}
callback(saveAndClose);
}
If my response helps you to resolve the issue close the question by Accepting solution and hit thumb icon. From Correct answers others will get benefited in future.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-23-2023 05:55 AM
now its not work :