I am trying to write a trigger as below. I need to further modify it so that it runs sequentially. i.e.
When an issue is raised in related dept, it passes through multiple approval levels.
So below code is w.r.t. to 1st approval level. I am trying to write code so that for first level, mail goes to all people with p.approver ='Approver 1' in related dept.
Then when approved ='Y' from all the people in application, i.e. both X and Y who are Approver 1 set Approved button as Y logging in separately,(it is via oracle apex app). Then email would shoot to next Approver 2 and so on. So could you please suggest ways i could make this trigger dynamic so that email is triggered from Approver 1...n for prticular dept.
CREATE OR REPLACE EDITIONABLE TRIGGER "P_IT_ISSUES_AIU_Notify_Approver_1" AFTER insert on P_IT_ISSUES for each row FOLLOWS P_IT_ISSUES_AIU_EMAIL begin For c1 in( select p.person_id ,p.person_email,i.dept_name from p_it_people p,p_it_departments i where p.assigned_dept=i.dept_id and i.dept_id=:new.related_dept_id and p.approver='Approver 1')
In short:
Looking forward to your help.