This content has been marked as final. Show 6 replies
We had same requirement, where we wanted to have a restriction for employees but open for HR guys. We had used a user hook to achieve this because if we add the validation in BG_ABSENCE_DURATION it will fire for all, provided if we can distinguish the responsibility been used.
Please find the details below:
1. Define the procedure which will do validation for you
p_business_group_id NUMBER ,
p_absence_attendance_type_id NUMBER ,
p_abs_attendance_reason_id NUMBER ,
p_date_start DATE ,
p_date_end DATE ,
SELECT fnd_global.resp_name INTO l_resp_name FROM dual;
IF l_resp_name LIKE '%Employee%Self%' THEN -- do the validation only for self-service appliactions
--Do your validation and raise exception
l_error_msg := l_mgr_name || ' who is currently assigned as your reporting manager is not active. Please reach HR to get a valid reporting manager assigned.';
FND_MESSAGE.set_token('ERRMSG', l_error_msg, FALSE);
2. Register a hook on HR_PERSON_ABSENCE_BK1
(p_validate => false,
p_effective_date => sysdate,
p_api_hook_id => 3839,
P_API_HOOK_CALL_TYPE => 'PP',
p_sequence => 4000,
p_enabled_flag => 'Y',
p_call_package => 'XX_LMS_CUSTOM_PKG',
p_call_procedure => 'ABSENCE_VALIDATION',
p_api_hook_call_id => l_api_hook_call_id,
p_object_version_number => l_object_version_number);
3. Run the preprocessor
Hope this helps.
I believe you could disable BG_ABSENCE_DURATION formula for your HR Responsibility.
Set the following profile option:
HR: Absence Duration Auto Overwrite - No
at responsibility level.
You can also check to see if you can return profile options in fast formula, that way you can get responsibility_id as well.
Edited by: igwe on Feb 8, 2013 4:09 AM