- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-19-2016 04:57 PM
Hi,
Here is what I need:
When a user resolves/closes a Problem from the form, if there are any related Incidents then the states of these incidents need to be automatically set to resolved. This is quite easy to do using a UI Action and some scripting. There is one caveat though, I need the user to select 3 fields that will be set in all these related Incidents prior to closing the problem (e.g. Incident Close Code, Incident Resolved By, Incident Close Date).
Here is the issue I'm running into:
I figured I could do this using GlideDialog pop up box and retreive the necessary fields, then update all the incidents with these values. But when a user clicks the button "Close Problem" and my popup shows, there's no way to retrieve the values from the popup box and send them along with the server side script that gets called from the UI Action after it's complete. I can update all the incidents from the UI Page "Processing Script" too, but then I lose the Problem form submission.... I feel like I'm caught in a catch 22 situation. Does anyone know of a way around this?
Thanks,
-Tyson
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-20-2016 09:53 PM
Hi Tyson,
I mimicked the scenarios and I got what you are struggling with.
I can think of two ways to solve this
1) Capture the information you require to update the "Problem" record via dialogue box only with additional input fields configured on dialogue box . Whatever the information entered, you pass it on to script include and update the problem record. At the same time, you will have the information required to update related "Incidents" via dialogue box and process it in script include.
2) Have the UI Action button update the "Problem" record only via normal way, user will enter details onto the actual problem form, will click on the UI Action button which will update the problem. Once done, redirect user to same problem record. Now you will have "Problem" state changed to "Resolved" so configure UI Policy which will trigger when condition is resolved. Call the Dialogue box via this UI Policy and update the related incidents. You will have to configure some checkbox on Problem table which will check whether to call the Dialogue box. Else, Dialogue box will be called everytime form is opened and state is resolved.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-19-2016 08:23 PM
Yep, I actually did all of that.
But the real issue is that the user may change fields on the problem form, then click the UI Action "Resolve Problem". This means I have to sync those updates as well. How can I have a Dialog Popup handle it's side of saving the Incidents, but then have the UI Action save the problem fields that were updated?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-19-2016 08:26 PM
Hi Tyson,
You can do that in client callable script include only since you have also passed the sys_id of the problem record
So something like
var pr = new GlideRecord('problem');
pr.get('sys_id passed on');
pr.update(); // saves problem record
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-19-2016 08:43 PM
Hi Deepak,
Wouldn't I have to pass in every single field from the problem form into the Dialog UI Page? I'm not sure I would want to go down that road...
Also, after the UI Page saves I would have to issue a redirect command to reload the Problem form. This might also cause another issue being that I'll get a popup saying "Confirm Navigation, Changes have been made, continuing will discard the changes.... etc" which the user will have to click "Leave this Page".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-19-2016 09:36 PM
Give me some time, i will mimic this in my dev instance.
For problem record save, you will not have to pass on the field info to save it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-20-2016 12:41 PM
Thanks Deepak. If you can find a way for me to save the Problem Form and also save the Incidents from the dialog box that would help me out! It appears like it isn't possible, but maybe there is something I'm missing.
Somehow the dialog box would have to appear Post save of the Problem form....