
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2018 12:58 AM
Hi!
Setup:
I have a UI Action from the Incident form, a button.
The button opens a dialog that loads data from the Time Card table, showing reported time on the incident connected to the employee.
The dialog has a number of fields that the user can change and some of the are pre populated with data from the incident and also data retrieved from other tables.
The issue:
When saving the form to the Time card table, pressing the submit button in the form, the page reloads, and instead of closing the dialog and returning to the incident form, the dialog "takes over" and the incdent form is "lost".
On pressing submit
I have tried to trigger the processing script in a few ways and then only way I can get it to work is with a simple Submit Button
<div class="right"><button>Submit</button></div>
This will not even trigger the Processing script.
<g:dialog_buttons_ok_cancel ok="return validateDialog()" ok_type="button" cancel_type="button" />
the validateDialog() in client script , closes the dialog and returns true, and then nothing happens
function validateDialog() {
GlideDialogWindow.get().destroy(); //Close the dialog window
return true;
}
What I want to achieve, is to close the dialog, save the data and return to the incident form.
I can close the dialog box,via client script, but I cant trigger the processing scrip or I can trigger the process script but not close the dialog and return to the incident form.
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2018 02:25 AM
This fixed it.
Added to the Processing script;
var urlOnStack = GlideSession.get().getStack().bottom();
response.sendRedirect(urlOnStack);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2018 04:10 AM
Hello,
Have you added the <g:ui_form> in your html field?
You need to add name attribute in any field you are fetching in processing script.
It will be easy for us to check if you provide screenshots of your UI page.
Thank you
Dante

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2018 04:39 AM
Hi Dante!
Yes I have named all the inputs and attributs that I expect to retrieve from the form and that works, the processing script works and the data is saved in the table.
But I cant get it to be destroyed, but instead it reloads it self as the main window. As shown in screen shots above.
Yes I have the <g:ui_form> tag (see pic)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2018 04:54 AM
Can I have your client script? Did you put return false; on it?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2018 05:26 AM
I don't have a client script at the moment...
But I had a client script that returned true;
My button goes direkt to the Processing Script.
In the original post you have the clinet script that I used, that closed the dialog but failed to save...
function validateDialog()
{
GlideDialogWindow.get().destroy(); //Close the dialog window
return true;
}