- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-03-2024 01:33 AM
I've made a copy of the "Cancel" UI Action on sn_hr_core_case (HR Agent Workspace.) I've also copied the script include to modify with my custom fields. I'd like to customize the popup to display a reference field instead of the work notes. Everything appears to have worked except the results in the reference field are not displaying.
I've updated the type, name and label. Is there something I'm missing?
function onClick(g_form) {
getMessages(['Canceled Reason', 'Cancel Case', 'Provide a reason for canceling the case.', 'Enter a reason for canceling', 'This action can\'t be undone.', 'Don\'t cancel', 'Cancel case'], function(){
var fields = [{
type: 'reference',
name: 'u_canceled_reason',
label: getMessage('Canceled Reason')
}];
var sysId = g_form.getUniqueValue();
var tblName = g_form.getTableName();
g_modal.showFields({
title: getMessage('Enter a reason for canceling'),
fields: fields,
instruction: getMessage('This action can\'t be undone.'),
size: 'md',
cancelTitle: getMessage('Don\'t cancel'),
confirmTitle: getMessage('Cancel case'),
cancelStyle: 'default',
confirmStyle: 'destructive'
}).then(function(fieldValues) {
//get the work note entered
var cancelReason = fieldValues.updatedFields[0].value;
//Call the Ajax function that handles adding worknotes and state
var s = new GlideAjax("sn_hr_core.hr_CancelAjax");
s.addParam("sysparm_name", "cancelAction");
s.addParam("sysparm_obj_id", sysId);
s.addParam("sysparm_table_name", tblName);
s.addParam("sysparm_u_canceled_reason", cancelReason);
s.getXML(addNotes);
function addNotes(response) {
g_form.save();
}
});
});
}
Missing results
Solved! Go to Solution.
- Labels:
-
Human Resources Service Delivery
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-03-2024 04:46 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-03-2024 04:46 AM
The issue was corrected via https://www.servicenow.com/community/developer-forum/hr-case-cancel-u-action-customization/td-p/2885...