Create HR Case from Interaction record
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-16-2024 03:29 AM - edited ‎09-16-2024 03:37 AM
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. 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-16-2024 05:34 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-16-2024 05:37 AM
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"
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-19-2024 11:50 PM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-30-2024 06:59 AM
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"
}