cancel
Showing results for 
Search instead for 
Did you mean: 

How to find the holidays between employee leaves in CPI

former_member60331
Participant
0 Kudos

Hi Experts,

I am fetching employee leaves data from Employee Central and I am using EmployeeTime entity to fetch the same.

Now, I have a requirement to check if at all there was any Holiday that occured between my leaves also I want to calculate the count of Holidays between my leaves date.

Can you please help to understand how to achieve this in CPI?

Regards,

Akash

sunny_kapoor
Advisor
Advisor
0 Kudos

Hi akashenoc ,

Do you have any API to give the list of holidays between a given period?

Regards,

Sunny

Accepted Solutions (0)

Answers (4)

Answers (4)

Sriprasadsbhat
Active Contributor

Hello Akash,

You can leverage API HolidayCalendar with navigation holidayAssignments to get all the holidays for the country employee belongs and then you can put a logic to find if any holiday occurs between leave start date and end date( there are no straight forward API which gives the output you are looking for and you should put some logic to derive that )

You can go through OData data dictionary to have an idea on different APIs available.

Sample Query:

$select=externalCode,country,createdBy,createdDate,createdDateTime,lastModifiedBy,lastModifiedDate,lastModifiedDateTime,lastModifiedDateWithTZ,mdfSystemEffectiveEndDate,mdfSystemEffectiveStartDate,mdfSystemEntityId,mdfSystemObjectType,mdfSystemRecordId,mdfSystemRecordStatus,mdfSystemStatus,mdfSystemTransactionSequence,mdfSystemVersionId,name_de_DE,name_defaultValue,name_en_DEBUG,name_en_GB,name_en_US,name_es_ES,name_fr_FR,name_ja_JP,name_ko_KR,name_localized,name_nl_NL,name_pt_BR,name_pt_PT,name_ru_RU,name_zh_CN,name_zh_TW,oldName,holidayAssignments/HolidayCalendar_externalCode,holidayAssignments/date,holidayAssignments/holidayClass,holidayAssignments/holiday&$expand=holidayAssignments

Regards,

Sriprasad Shivaram Bhat

m_radziewicz_ey
Explorer
0 Kudos
MortenWittrock
Active Contributor
0 Kudos

Hi Akash

If you mean finding public holidays between two dates, you probably need to find an API for that. There might exist a Java library, but I think you'd be better off with a service.

Regards,

Morten

former_member60331
Participant
0 Kudos

Hi Morten,

Yes, I want to find holiday between employee's leaves date.

For eg. If employee applied for leaves from 1 August 2020 to 30 August 2020, then I need to calculate how many public holidays were there in between these days for this employee ( as the holidays are region/location dependent)

Regards,

Akash

Sriprasadsbhat
Active Contributor
0 Kudos

Hello Akash,

Do you mean you want to calculate no of holidays that occurred for an employee from Employee Start date to till he leaves the organization ( after termination ).Also please provide example scenario to know what exactly you are looking for since your question is not clear.

Regards,

Sriprasad Shivaram Bhat

former_member60331
Participant
0 Kudos

Hello sriprasadshivaramabhat,

I want to find calculate no of holidays between employee's leaves date.

For eg. If employee applied for leaves from 1 August 2020 to 30 August 2020, then I need to calculate how many public holidays were there in between these days for this employee (as the holidays are region/location dependent)

Regards,

Akash