Amending 'Close' UI Action on Interactions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-04-2023 02:33 AM
Good morning,
We have a requirement to amend the UI Action 'Close' on Interactions. Currently this just straight up closes an Interaction as Closed Complete, and doesn't require any information being input to advise why.
What we want to be able to do is when a user clicks 'Close', it flags the Work Nots field as mandatory and doesn't allow it to be closed.
For ref, this is the current script on the UI Action -:

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-04-2023 03:02 AM
Could you click the Advanced Related link in the UI Policy, and share a screenshot again?
Also could you provide a screenshot of you closure code dictionary record?
Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-04-2023 03:09 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-04-2023 05:08 AM
Thanks @StewartFletcher,
It looks ok to me, assuming the default value is empty?
You could use this script in UI action to fill the close notes based on a popup:
function confirmDialog() {
var gm = new GlideModal('confirm');
// Sets the dialog title
gm.setTitle('Confirmation');
// Sets up valid custom HTML to be displayed
gm.renderWithContent('<div style="padding:15px"> <p>Close task?</p> <label for="notes" class="form-label">Provide Close Notes</label> <br /> <textarea name="notes" id="notes"></textarea> <br /> <div style="padding:5px;float:right"> <button style="padding:5px;margin-right:10px" onclick="top.window.takeAction(this.innerHTML)" class="btn btn-default">Cancel</button> <button style="padding:5px" onclick="top.window.takeAction(this.innerHTML,jQuery(\'#notes\').val())" class="btn btn-primary">Submit</button> </div> </div>');
// We'll use the windows object to ensure our code is accessible from the modal dialog
top.window.takeAction = function(thisButton, notes) {
// Close the glide modal dialog window when either button is pressed.
gm.destroy();
// Perform the appropriate action on the client.
if (thisButton === 'Submit') {
g_form.setValue('u_closecode', '<<your closed value>>')
g_form.setValue('close_notes', notes);
g_form.save();
} else if (thisButton === 'Cancel') {
return false;
}
};
return false; // Prevents the form from submitting when the dialog first loads
}
Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2023 12:37 AM
Unfortunately putting that in just breaks the button completely. You click it and it does nothing.