Create HR Case from Interaction record

Simanta27
Tera Contributor

Hi Everyone,

We have an UI Action "Create HR Case" on Interaction form in our Agent Workspace for HR Case management.

Currently, clicking on this UI Action redirects the user to HR Case Creation page with "Opened For" & "Subject Person" values auto populated with the "Opened For" of the Interaction record, we want to change this and have it like:

1. Opened For of Interaction record should be auto populated as Opened For of HR Case.

2. Opened By of Interaction record should be auto populated as Subject Person of HR Case.

Can anyone help with the solution on how to change this?

Thanks in advance. 🙂

 

5 REPLIES 5

Sid_Takali
Kilo Patron
Kilo Patron

Hi @Simanta27 I don't have installed HR Application on my PDI. Please share the "Create HR Case" UI Action script? not screenshot please paste code

 

Hi @Sid_Takali , It's an Action Assignment and the payload is having the following code:

{
"route": "case-creation-page",
"fields": {
"sysId": "-1"
},
"params": {
"interactionRecordOpenedFor": "{{fields.opened_for.value}}",
"interactionId": "{{sysId}}"
},
"multiInstField": "sysId",
"targetRoute": "current"
}

Shambhu K B
Giga Guru

Hi @Simanta27 :

please use the below code in UI action "Create HR Case"

 

function onClick() {
	var USER = g_form.getValue('opened_for');
        var subjectPerson = g_form.getValue('opened_by'); // get the value of subject person
	var NEW_RECORD = '-1';
	var TABLE_HR_CASE = 'sn_hr_core_case';
	var PARENT_TABLE = g_form.getTableName();
	var PARENT_SYS_ID = g_form.getUniqueValue();
// pass the subject person value below
	g_aw.openRecord(TABLE_HR_CASE, NEW_RECORD, {userId: USER, subjectPersonIdOnCase: subjectPerson , parentTable: PARENT_TABLE, parentSysId: PARENT_SYS_ID});
}

you can find the UI action by navigating to  UI actions > Create HR case ( filter Table is interaction).

the above script should be in workspace script.

 

Please mark correct/Helpful if my explanation answers your question.

 

Regards,

Shambhu

Hi @Shambhu K B , here we are making use of Action assignment and not the UI action.

Code :

{
"route": "case-creation-page",
"fields": {
"sysId": "-1"
},
"params": {
"interactionRecordOpenedFor": "{{fields.opened_for.value}}",
"interactionId": "{{sysId}}"
},
"multiInstField": "sysId",
"targetRoute": "current"
}