Skip to Content

How to find the holidays between employee leaves in CPI

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

Add a comment
10|10000 characters needed characters exceeded

Related questions

4 Answers

  • Posted on Jul 16, 2020 at 06:47 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 15, 2020 at 10:10 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

    • Hello Sriprasad,

      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

  • Posted on Jul 15, 2020 at 10:33 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

    • 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

  • Posted on Jul 16, 2020 at 06:43 AM
    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.