Unable to put a check for a form [message #463926] |
Mon, 05 July 2010 04:41 |
sreejith.s
Messages: 26 Registered: November 2009
|
Junior Member |
|
|
Hi All,
I have a leave form where I need to put a check which prevents the user from entering 'sick leave' if the employee hasn't completed 3 months in the company.
This is the code I've written:
SELECT ABS(MONTHS_BETWEEN(t.start_date,sysdate)) INTO l_date
FROM hrp_per_all_people_f t
WHERE t.company_id = :parameter.p_company_id
AND t.employee_number = :parameter.p_employee_number
AND t.effective_end_date = '31-dec-4712';
IF :hrp_per_absence_assignment.absence_type_id = 21 THEN
IF l_date < 3 THEN
aid := Find_Alert('COMMON ALERT');
SET_ALERT_PROPERTY(aid, alert_message_text, 'This employee has not completed three months and is not eligible for sick leave' );
alert_id := SHOW_ALERT( aid );
RAISE FORM_TRIGGER_FAILURE;
END IF;
END IF;
The absence_type_id = 21 is for 'sick leave'. I can't figure out why this is not working. When I do enter 'sick leave' for a new employee I do not get any checks and neither am I able to save the changes.
Kindly help.
Regards,
Sreejith
|
|
|
|
|
|
|
|
|