I am working on Leave Workflow. Its working fine but my issue is when requester applies for leave in portal there approver screen field is there and it is a mandatory field and by default its giving the immediate superioir, in case if the employee applies leave for past dates then it should send to another manager. as per workflow a workitem is sending to the correct person but in the portal as there is RM ID is there in the approver field so a workitem is also appearing in the RM selection list also.
Can anybody please suggest me how to default the approver name as per the requirement? is there any BADIs are there to fulfil this requirement.
If so please let me know the BADIs