I wanted to make all editable fields readonly, after incident state is closed.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
Dear Community Members
I wanted to make all editable fields readonly, after incident state is closed.
Can someone provide me clientscript for this requirement.
Please help, thanks for your support
Labels:
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
22m ago
Hi,
Always try to figure things out on your own first, as it’s a great way to build your skills. If you get stuck at any point, you can ask for help anytime. 🙂
Here is the code:
function onLoad() {
// Check if Incident state is Closed
if (g_form.getValue('state') == '7') {
// Get all fields on the form
var fields = g_form.getEditableFields();
// Make all editable fields read-only
for (var i = 0; i < fields.length; i++) {
g_form.setReadOnly(fields[i], true);
}
}
}
