Hi Malin,
Regarding the requirement to mandate attachments for specific absence types like Medical Leave, there is no standard, out-of-the-box functionality in IFS Cloud that allows you to configure mandatory attachments per absence type directly through simple settings.
To achieve this, we have successfully implemented a custom solution using an event action. This action triggers during the absence registration process, checks the absence type, and validates whether an attachment has been added for those specific types (e.g., Medical Leave). If not, it prevents the user from submitting the request and prompts them to attach a supporting document.
This solution is working effectively to meet the exact requirement you described.
I would be happy to share the details of this event action configuration with you or discuss it further if you think it would be beneficial.
Best regards,
Syed Mohsin
Hi @Syed.
Thank you for your reply.
It would be appreciated, if you can share me more details about event configuration including event body.
Regards,
MalinG
Hi Malin,
I'd be happy to provide more details on the event configuration. Please find the information you requested.
Regards
Syed Mohsin
DECLARE
PRAGMA AUTONOMOUS_TRANSACTION;
CURSOR GET_DOC_COUNT IS
SELECT COUNT(*) FROM DOC_REFERENCE_OBJECT
WHERE lu_name = 'HolidayPlan'
AND KEY_REF = 'COMPANY_ID=' || '&OLD:COMPANY_ID' || '^EMP_NO=' || '&OLD:EMP_NO' || '^PLAN_ID=' || '&OLD:PLAN_ID' || '^';
v_count NUMBER;
BEGIN
OPEN GET_DOC_COUNT;
FETCH GET_DOC_COUNT INTO v_count;
IF v_count = 0
AND '&NEW:ROWSTATE' = 'Confirmed'
AND '&OLD:ABSENCE_TYPE_ID' = 'SL'
THEN
ERROR_SYS.RECORD_GENERAL('HolidayPlan', 'Err : Please Attach Sehhaty Certificate before Confirm.');
END IF;
CLOSE GET_DOC_COUNT;
END;
Hi @Syed,
Thank you. I will try this out.
Regards,
Malinda.