Thursday, 25 January 2018

Workflow Customization : How to restrict PO approval Notification to send to some specific Employees in the Position Hierarchy.

Workflow Customization : How to restrict PO approval Notification to send to some specific Employees in the Position Hierarchy.

Step1:- Open the PO approval workflow in workflow builder and then open Find Approver Process as below.

Step2:- Go to Get First Manager Approval Hierarchy Function in the process.

Step3:- Copy the name of PLSQL function

Step4:- Go to this package in Database and open it.
Step5:- In this package go to function as below

FUNCTION GetMgrHRHier(itemtype VARCHAR2, itemkey VARCHAR2)

Step6:- You can see below here in this function , workflow is setting the value of Next approver.
if you found this post helpful and you liked it then follow this blog to get notifications for the upcoming posts.
Step7:-  These are two below cursors are using to set the next approver. You just to put Not in condition in their where conditions with that employee Id's for which you don't want to sent approval Notification.

CURSOR c1 (p_empid NUMBER, p_business_group_id NUMBER) IS

SELECT pafe.supervisor_id

FROM   Per_All_Assignments_f pafe,  -- <BUG 6615913>

       Per_All_People_f ppfs,       -- <BUG 6615913>

       Per_All_Assignments_f pafs,  -- <BUG 6615913>

       per_person_types_v ppts,

       per_person_type_usages_f pptu

WHERE  pafe.business_group_id = p_business_group_id

       AND pafe.person_id = p_empid

       AND Trunc(SYSDATE) BETWEEN pafe.Effective_Start_Date

                              AND pafe.Effective_End_Date

       AND pafe.Primary_Flag = 'Y'

       AND pafe.Assignment_Type IN ('E','C')

       AND ppfs.Person_Id = pafe.Supervisor_Id

       AND Trunc(SYSDATE) BETWEEN ppfs.Effective_Start_Date

                              AND ppfs.Effective_End_Date

       AND pafs.Person_Id = ppfs.Person_Id

       AND Trunc(SYSDATE) BETWEEN pafs.Effective_Start_Date

                              AND pafs.Effective_End_Date

       AND pafs.Primary_Flag = 'Y'

       AND pafs.Assignment_Type IN ('E','C')

       AND pptu.Person_Id = ppfs.Person_Id

       AND ppts.person_type_id = pptu.person_type_id
       AND ppts.System_Person_Type IN ('EMP','EMP_APL','CWK');  


Post a Comment