- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-13-2018 07:02 AM
Hello,
I created some buttons on the Create HR Case Form, they call a function that I created to try and set the two values in COE and HR Service and then call the CreateCase() function after the two fields get set as would normally occur if someone selected the options and clicked create.
I'm doing something wrong with trying to set the value of the two reference fields as when it hits the create case function, an error is thrown "Failed to retrieve service"
$scope.setCOE = function() {
$j("#coe_input").select2("data", { display: 'HR Payroll Case', table: 'sn_hr_core_case_payroll' });
$j("#service_input").select2("data", { display: 'Payroll Discrepancy', table: 'sn_hr_core_case_payroll' });
return $scope.createCase();
};
Solved! Go to Solution.
- Labels:
-
Case and Knowledge Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-18-2018 04:20 PM
It fails to retrieve the service because you did not set the sys_id for the #service_input option.
The values to set for the #service_input are sys_id, coe, display, template, parent, e.g.:
$j("#service_input").select2("data", { sys_id: 'SERVICE_SYS_ID', coe: 'sn_hr_core_case_payroll', display: 'Payroll Discrepancy', template: 'TEMPLATE_SYS_ID', parent: 'Topic Category Name' });
Note: There is extra logic on the page that you may be skipping by bypassing the normal route.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-16-2018 03:25 PM
Can you confirm the use case or provide screenshots of the page after modifying it? It looks like you are trying to create shortcut buttons so that instead of the agent selecting the COE and Service from the drop-down, they click a button on the page that pre-populates the COE and Service and then creates the case. Is that correct?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-18-2018 04:20 PM
It fails to retrieve the service because you did not set the sys_id for the #service_input option.
The values to set for the #service_input are sys_id, coe, display, template, parent, e.g.:
$j("#service_input").select2("data", { sys_id: 'SERVICE_SYS_ID', coe: 'sn_hr_core_case_payroll', display: 'Payroll Discrepancy', template: 'TEMPLATE_SYS_ID', parent: 'Topic Category Name' });
Note: There is extra logic on the page that you may be skipping by bypassing the normal route.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-14-2018 09:24 AM
Thank you! This worked perfectly for what I was trying to achieve.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-01-2019 11:29 AM