How to add Suspend Reason from Suspend Dialog Box to the work notes?

Brian31
Kilo Contributor

Hello everyone, 

I have a simple request but is proving to be a little more complicated than I anticipated. I'd like to add the On Hold Reason (Other, User, etc) to the work notes but looking into the Suspend Dialog Box client script, I'm not seeing how to get that information added. It looks like the reason is already getting captured somewhere but I can't get that value to populate in the work notes from the attempts I've had so far. Any ideas?

 

//Call the Ajax function that handles adding worknotes and state
var s = new GlideAjax("sn_hr_core.hr_CaseAjax");
s.addParam("sysparm_name", "suspendCaseAction");
s.addParam("sysparm_obj_id", sysId);
s.addParam("sysparm_table_name", tblName);
s.addParam("sysparm_work_note", newWorkNote);
s.addParam("sysparm_suspend_reason", newReason);
s.getXML(addWorkNotes);

function addWorkNotes(response) {
g_form.save();

}

find_real_file.png

find_real_file.png

5 REPLIES 5

Jaspal Singh
Mega Patron
Mega Patron

Did you try checking sys_choice table?

Apply below filter in sys_choice table

Table: sn_hr_core_case

Element: sla_suspend_reason

 

Community Alums
Not applicable

Hi Brian,

You can get the values from sys_choice table or from sla_suspended_reason field.

Please refer to this thread which will help you for your solution:

https://community.servicenow.com/community?id=community_question&sys_id=f7c5b486dbe89010190dfb24399619df

 

Mark my answer correct & Helpful, if Applicable.

Thanks,

Sandeep

Thanks for the reply. I read through that solution but it didn't quite answer what I'm trying to accomplish but it does help point me in the right direction.

Hi Sandeep,

In HR form, we are using Suspend UI action and OOB we are getting Reason & Work Notes field in the dialog box. Now, we would like to make Due Date field as mandatory in the form when Suspend Reason dialog box change gets saved?

I think making a field mandatory when the control is in dialog box would be quite tricky. However, I think I should include Due Date too in the Suspend Dialog Box and make it mandatory and after filling the value should be displayed in the Due Date field in the form.

Could you please help or guide me to achieve this?

Quick reply would be much appreciated.