Issue in Business Rule
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2025 06:49 AM
Hi,
I have created a "Reopened" checkbox with a read-only condition in the Incident record and set its default value to false.
Scenario:
When the incident is in any state up to Resolved, the Reopened checkbox is unchecked (false). Once the user wants to reopen the incident (i.e., the state changes from Resolved to New, In Progress, or On Hold), the Reopened checkbox should be automatically checked (true) and set to read-only. Additionally, I want the Resolution Notes and Resolution Code fields to be cleared when the incident is reopened.
I have implemented this in Business Rule. But not getting solution. Can anyone help me on this?
Thanks,
Abirami
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2025 07:29 AM
@Service now11 - As shared by Ankur it will work for you or do share your script so we can help you.
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2025 09:39 PM
Hi,
I have created an "onChange" client script that triggers when the state changes from "Resolved" to previous states like "New," "In Progress," or "On Hold." In this case, the "Reopened" checkbox should be checked (true). For all other states (such as "New," "In Progress," "On Hold," "Resolved," "Closed," or "Cancelled"), the "Reopened" checkbox is set to its default value of false. And also i have created "onLoad" client script for "Reopened " checkbox default value is false.
I am still not getting the expected solution. Could anyone help me identify what might be going wrong with this approach?. Here is my client script:
onChange Client script:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2025 10:58 PM
Hi @Service now11,
I believe that your onChange Client script is setting the 'u_reopen' field to True only when the State is changed from 'Resolved' to either New / In Progress / OnHold.
But after the State value change as you save the form, it will re-load and hence your onLoad Client Script will come into play, setting the 'u_repoen' field to False again.
I assume that after the Incident was first re-opened, you want the 'u_reopen' field to stay True indefinetly.
For this, you can update the if statement of your onLoad client script as
if (g_form.getValue('u_reopen'){
g_form.setReadOnly('u_reopen', true);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2025 06:22 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2025 01:11 AM
Hello @Service now11
Why to make complex by writing too many scripts. Let's make it simple.
As per your requirement, I tried this in my PDI, first created a true/false type field with name "Reopened" and made it read-only at dictionary level itself as looking in your requirement it will be auto populated when it met condition.
Now a simple BR without much scripting as showcased below:
Now time for testing took a existing incident opened it and we can see clearly its In Progress so we change to Resolved.
Now we change state back to In Progress from Resolved and we can see Reopened field is true and resolution code and notes field is cleared.
If you follow same thing, you will be able to achieve same. If still any issue do let me know.
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.