How to delete Element Links in Oracle HRMS Payroll


  1. Once Element Entries are deleted, you also need to delete standard element links. 
  2. As standard element links were mistakenly created, so we will first delete standard element links, then create non-standard element links.
NOTE: Following procedure will delete all the element links, so Please amend the query according to your requirement.

PROCEDURE


CREATE OR REPLACE PROCEDURE APPS.DELETE_ELEMENT_LINKS
IS
   CURSOR c_comp
   IS
      SELECT   effective_start_date, element_link_id,
               object_version_number
          FROM pay_element_links_f;

   lc_c_comp                 c_comp%ROWTYPE;
   l_comp_id                 NUMBER;
   l_effective_start_date    DATE;
   l_effective_end_date      DATE;  
   l_entries_warning         Boolean;
  



BEGIN
   OPEN c_comp;

   LOOP
      FETCH c_comp
       INTO lc_c_comp;

      EXIT WHEN c_comp%NOTFOUND;
      BEGIN
      DBMS_OUTPUT.put_line('Ran');

         pay_element_link_api.DELETE_ELEMENT_LINK
            (p_validate                          => FALSE
            ,p_effective_date                    => lc_c_comp.effective_start_date
            ,p_element_link_id                   => lc_c_comp.element_link_id
            ,p_datetrack_delete_mode              => 'ZAP'
            ,p_object_version_number             => lc_c_comp.object_version_number
            ,p_effective_start_date                 => l_effective_start_date
            ,p_effective_end_date                => l_effective_end_date   
            ,p_entries_warning                   => l_entries_warning        
            );
            DBMS_OUTPUT.put_line(l_effective_start_date);

      END;

      l_effective_start_date := NULL;
      l_effective_end_date := NULL;
       
        
     
   END LOOP;

   CLOSE c_comp;
EXCEPTION
   WHEN OTHERS
   THEN
      DBMS_OUTPUT.put_line (SUBSTR (SQLERRM, 1, 254));
END;
/

Leave a comment for any query.


2 comments:

  1. not working with link to all payroll???!!


    dodo_maksoud@hotmail.com

    ReplyDelete
    Replies
    1. Hi Maksoud,

      If your element links are standard, you first need to delete element entries or any other process done after the Element link creation.

      Kindly re-check the procedure..because all the columns are binded in the procedure.

      Delete