Get Started with Redwood for Oracle Cloud HCM Begin Now
Create a fast formula validation on absence end date
Summary:
Hello,
I have a requirement to forbid employees from taking absences that end on Friday if the leave duration is more than 3 days. For that, I have wrote the below formula but it's not working. The system is allowing the employee to enter absences that end on a Friday.
INPUTS ARE IV_TOTALDURATION (number), IV_END_DATE (date),IV_START_DATE (date),IV_END_DURATION (date)
VALID='Y'
l_friday = NEXT_DAY(IV_END_DATE,'FRIDAY')
if IV_TOTALDURATION >2 and IV_TOTALDURATION <15
then
(
VALID = 'N'
ERROR_CODE = 'E'
ERROR_MESSAGE = 'CORIS_DURATION_ERROR'
)
else
if IV_TOTALDURATION >3 and
IV_END_DATE= l_friday
0