we have a lot old shift references for our FME’s which are in the past.
Does anyone have an API to delete them via Import?
I tried to build own API, but this is giving error message that at least one valid shift must be there, allthough there are many shifts and the one I try to delete is in the past
I do not have an API, but I do have a SQL script provided by Astea to manage the employee shifts. We run once a year.
--US0009154
--Backup Table /* select * into person_shift_xref_bkup_20211110 from person_shift_xref */
/* delete */ select * from person_shift_xref where (effective_start_dt >='2008-01-01 00:00:00.000' and effective_end_dt <='2020-10-31 00:00:00.000') order by effective_start_dt
/* delete from person_shift_xref where (person_shift_xref.person_id in(select person_id from employee em where em.node_id='SG-PA') and person_shift_xref.effective_start_dt >='2008-01-01 00:00:00.000' and person_shift_xref.effective_end_dt <='2020-10-31 00:00:00.000')
delete from person_shift_xref where (effective_start_dt >='2008-01-01 00:00:00.000' and effective_end_dt <='2020-10-31 00:00:00.000') */
Hi Torsten,
An employee must have at least one working shift definition.
You cannot delete it unless the person has multiple shifts.
If the shift is no longer valid, I suggest that you update it with the new and current value.
Below is the API sample for an update. The red line is the new shift_id.
thanks a lot so far. Your help is highly appreciated
My problem is, that on my first screen the person has around 600 shift entrys. The one I tried to delete is an very old one, so it is not valid any more and he has valid current shifts for current date.
Nevertheless the API is giving the error, that at least one valid shift must be there. I try to show more detailled with the following screens:
Regards
Torsten
Hi Torsten,
Please try the below syntax for deletion in employee_shift_xref section
thanks again all participants for supporting here. But still the API is not working. :-(
I think the API in main section tries to create new employee data. That would also explain, why I am getting with first API the message, that one shift must be there.