Updating record using UI page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2023 10:31 AM - edited 07-27-2023 10:33 AM
Hello ,
I need my pop-up (UI page) to update the Closing Response Field when I click on Close Case (UI Action) and then have the case closed.
The issue that I am getting is that when I click on my UI Action the pop-up is appearing but then a few seconds later it closes and doesn't go back to my record page.
Note that my UI Action is already executing another script to close the case using a script include.
I am not able to see what my error is.
Action Name : closeCase
Onclick : validateReason()
Condition : (new global.StateFlow().validFlow(current, '81fa1d32dba688d06f1a325f9d9619d0', 'manual'));
Script :
____________________________________________________________________
UI Page :
HTML :
Client Script :
//Validating that field is not empty in dialog
function validateComments() {
var comments = gel("closing_response").value;
comments = trim(comments);
if (comments == "") {
alert("Please provide Closing response to close case.");
return false;
}
GlideDialogWindow.get().destroy();
return true;
}
Processing script :
var notes = request.getparameter('notes');
var grCase = new GlideRecord('sn_customerservice_corporate_investigation');
grCase.u_closing_response = closing_response;
grCase.get('u_closing_reponse');
grCase.update();
var urlOnStack = gs.getSession().getUrlOnStack();
response.sendRedirect(urlOnStack);