4 Replies Latest reply on May 28, 2020 1:12 AM by 4071240

    Fast formula - Absence Entry Validation

    4071240

      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.

        • 1. Re: Fast formula - Absence Entry Validation
          AshishHCM

          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):

          Sample Fast Formulas ( Fusion HCM Release 9.2 : Absence Management)

           

          Hope this helps!

           

          Kind Regards

          Ashish

          • 2. Re: Fast formula - Absence Entry Validation
            4071240

            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

            • 3. Re: Fast formula - Absence Entry Validation
              AshishHCM

              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

              • 4. Re: Fast formula - Absence Entry Validation
                4071240

                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