- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-16-2023 02:02 PM
I am looking for a way to hide the Closed state on Cases, like the oob BR on the Incident form. Not as straight forward as I thought it would be. Relatively new to cases so any help is much appreciated.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-16-2023 09:21 PM
Hi @Rob Jennings,
You can hide with onload client script, or you can throw an alert like below. When a user selects closed state, the below code throws alert and sets the incident state to it's old state.
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
if (newValue == '3') {
alert('Manually selecting "Closed" is not allowed. Kindly "Resolve" the ticket.');
g_form.setValue('state', oldValue);
}
}
Please mark this answer as correct and helpful if it solves your issue.
Regards,
Siva Jyothi M.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-16-2023 09:02 PM
Hi,
You can write a onLoad script with the line of code-
g_form.removeOption('state','3');//assuming closed state back-end value is 3.
Thanks and Regards,
Saurabh Gupta
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-16-2023 09:21 PM
Hi @Rob Jennings,
You can hide with onload client script, or you can throw an alert like below. When a user selects closed state, the below code throws alert and sets the incident state to it's old state.
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
if (newValue == '3') {
alert('Manually selecting "Closed" is not allowed. Kindly "Resolve" the ticket.');
g_form.setValue('state', oldValue);
}
}
Please mark this answer as correct and helpful if it solves your issue.
Regards,
Siva Jyothi M.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-17-2023 08:46 AM
Thank you very much! That is an excellent solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-17-2023 10:24 PM
Glad the solution worked for you.