HR Case Cancel UI Action Customization

heathers_
Kilo Sage

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?

heathers__0-1712133032245.png

 

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

heathers__1-1712133111770.png

 

 

1 ACCEPTED SOLUTION
1 REPLY 1