Forum Stats

  • 3,875,565 Users
  • 2,266,946 Discussions
  • 7,912,256 Comments

Discussions

Fast formula - Absence Entry Validation

Cecilia-Oracle
Cecilia-Oracle Member Posts: 24 Employee
edited May 27, 2020 9:12PM in HCM Cloud Service

Hi Experts,

According to the client policy, employees are entitled to 3 days marriage leave per employment, the leave could be taken separately 6 months before/on/after date of registration of marriage.

I have created an entry validation formula to check the number of days that have been taken upon absence request submission, if the total taken is more than 3 days, error message will be shown and employees are not able to apply for marriage leave as the entitlement has been used up.

While I found that the no. of day taken of the employee could not be retrieved properly, please refer to the attached file for the created fast formula, I have tried to return the no. of day instead of the error message to further check the problems, it return 51 days which is far more than records that I checked for that employee (7 days). And the validation could not be done.

Would you please advise if there are any problem on the fast formula, thank you.

Answers

  • AshishHCM
    AshishHCM Oracle HCM Cloud Solution Architect Member Posts: 334 Bronze Crown
    edited May 23, 2020 1:11AM

    You probably are doing something wrong.

    You should be able to find number of absence taken in a specified period.

    Please refer below link (It has a pdf which has many FF Examples):

    Hope this helps!

    Kind Regards

    Ashish

  • Cecilia-Oracle
    Cecilia-Oracle Member Posts: 24 Employee
    edited May 24, 2020 10:38PM

    Hi Ashish,

    Thank you so much, in fact, I took reference for your attached doc to create this fast formula, but still having problem to get the correct number day. I have try to modify the formula in different ways but still cannot get the correct no. of day, would you please help to have a look below to check where is the problem, many thanks!

    CHANGE_CONTEXTS(START_DATE=ld_start_date, END_DATE=ld_marriage_end_date)

    (

    i=ANC_PER_ABS_ENTRS_ABSENCE_ENTRY_ID_ARR.FIRST(-1)

    WHILE ANC_PER_ABS_ENTRS_ABSENCE_ENTRY_ID_ARR.exists(i)

    LOOP

    (

    CHANGE_CONTEXTS(ABSENCE_ENTRY_ID=ANC_PER_ABS_ENTRS_ABSENCE_ENTRY_ID_ARR[i])

    (

    if((l_absence_type_id=ANC_ABS_ENTRS_ABSENCE_TYPE_ID) AND (ANC_ABS_ENTRS_ABSENCE_STATUS_CD <> 'ORA_WITHDRAWN'))

    then

    (

    l_days_duration = ANC_ABS_ENTRS_DURATION

    )

    l_days = l_days_duration + l_days

    )

    i= ANC_PER_ABS_ENTRS_ABSENCE_ENTRY_ID_ARR.NEXT(I,-1)

    )

    l_total_days = l_days + l_new_duration

    if(l_total_days > 3 )

    then

    (valid='N'

    ERROR_MESSAGE = 'The leave entitlement has been used up as employee are entitlement to the leave per employment'

    RETURN VALID, ERROR_MESSAGE

    Best regards,

    Cecilia

  • AshishHCM
    AshishHCM Oracle HCM Cloud Solution Architect Member Posts: 334 Bronze Crown
    edited May 27, 2020 1:09PM

    Hi Cecilia,

    Can you add some log statements to find out what is the value returned for l_total_days and l_days

    Kind Regards

    Ashish

  • Cecilia-Oracle
    Cecilia-Oracle Member Posts: 24 Employee
    edited May 27, 2020 9:12PM

    Hi Ashish,

    I have tried to return the value for l_total_days and l_days when apply a 2 days absence,

    l_total_days: 52

    l_days: 50

    And I have checked that there are only 7 days absence records with the specified absence type with status <> withdrawn. Please advise, thank you very much!

    Best regards,

    Cecilia