How to trigger Resolution Code & Solution before update?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2018 12:51 AM
Hi team,
This is probably an easy one.
When I place the status/state of the incident on "Resolved" and try to Update or Save the incident.
I expect to be thrown a message, stating that the Resolution Code and Solution field has be populated.
i.e. Mandatory.
What is happening in my case is; I am able to place the Incident in resolved status and save/update the ticket (without being thrown the prompt).
However, after I save the ticket and attempt to make any further updates. I am then prompted to select a Resolution Code and enter a Solution.
Funnily, the rule comes into effect AFTER the save.
I bet i'll kick myself once the answer is identified.
Thanks all.
- Labels:
-
Incident Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2018 01:26 AM
Hi B
Are you resolving it in the form or from the list view? Are you using a ui action or manually changing the state to resolved?
Looks like you have the fields as mandatory in the resolved state
So you are not in the resolved state and you save it then you are in the resolved state and it starts complaining there are mandatory fields
regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2018 11:19 PM
Apologies I should've been a bit more clear.
The intention is to resolve the incident in the form view.
Select Resolved from the Incident state drop-down list
Then click update.
-------------------------
At this stage the form should check to see if the resolution code and solution field have been changed/updated.
If not; as mandated by the mandatory function, it will prompt the user to do so.
//
What's occurring in my instance, is SN allows me to save/update the incident state to Resolved.
Without the resolution code or solutions field being populated.
However, any subsequent action which requires a save or update - will prompt you to update those fields.
----
I'm pretty sure I just need to change a rule from AFTER to BEFORE. Just cant find it at the moment 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-19-2018 03:52 AM
Ah ok
So you haven't change state or committed the data, this is all in the form context.
So I guess you are looking at an on change client script for the state field that does not accept null in a field called closure etc
Not the exact script but an on change client script, this only works in form actions if someone resolves in list then it won't catch you may wish to consider a business rule for that.
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue == '') {
return;
}
var comments = g_form.getValue('your_closure_code');
if (oldValue != 6){
if (newValue == 4 && your_closure_code == '')
{
g_form.setMandatory('your_closure_code',true);
}
else
{
g_form.setMandatory('your_closure_code',false);
}
}
else
{
if (newValue == 7 || newValue == 6)
{
g_form.setMandatory('your_closure_code',false);
}
else
{
if(comments == '')
g_form.setMandatory('your_closure_code',true);
}
}
}
Now there are some assumptions here you need to specify your field that you want rather than 'your_closure_code' and if you have states that are different modify to suit.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-19-2018 03:56 AM
That said client side logic for this is a bit poor.
It's more efficient in a business rule but if you want it before submission then you have little choice.
It always seems a shame to try to force something that an agent should know. Decent process and management would prevent you having to code this.
On small environments it doesn't really matter but on the bigger ones an extra client script that runs every time the table is addressed can lead to load issues.
From experience keep your client scripts to a minimum
Regards