1 Reply Latest reply on Aug 9, 2017 7:22 PM by Migs_Isip

    Remove Employee associated with Application User using api

    Migs_Isip

      Are there any APIs that can be used to remove the Employee/Person Field from the FND_USER application?

       

      For Example, I'm running the below script using FND_USER_PKG.UPDATEUSER but its not clearing out the Person and Customer Field but it only updates the End-Date Field:

       

      set serveroutput on;
      declare
      
      
          cursor c1 is
          select  *
          from    xx_dup_emp_records
          where   status = 'ReAssigned';  
      
      
      begin
      
      
          for c_1 in c1 loop
          
              FND_USER_PKG.UPDATEUSER (x_user_name                  => C_1.USER_NAME_1,
                                       x_owner                      => null,                                 
                                       x_end_date                   => trunc(sysdate),                                 
                                       x_employee_id                => null,
                                       x_customer_id                => null,
                                       x_email_address              => null);
                                                        
          end loop;
                                                                
      end;
      

       

      Once running the script above and committing, the Users screen only updates the End-Date:

      user screen.png

       

      How can i Remove the Person/Employee associated with this Username by means of an API?

       

      Thank you!

        • 1. Re: Remove Employee associated with Application User using api
          Migs_Isip

          I've opened a Service Request about this to Oracle and they've provided me a solution. I should not be using NULL, but should be using the FND_USER_PKG variables instead (fnd_user_pkg.null_number, fnd_user_pkg.null_char, fnd_user_pkg.null_date).

           

          set serveroutput on; 
          declare 
          
          
              cursor c1 is 
              select  * 
              from    xx_dup_emp_records 
              where  status = 'ReAssigned';   
          
          
          begin 
          
          
              for c_1 in c1 loop 
               
                  FND_USER_PKG.UPDATEUSER (x_user_name                  => C_1.USER_NAME_1, 
                                          x_owner                      => null,                                 
                                          x_end_date                  => trunc(sysdate),                                 
                                          x_employee_id                => fnd_user_pkg.null_number, 
                                          x_customer_id                => fnd_user_pkg.null_number, 
                                          x_email_address              => fnd_user_pkg.null_char); 
                                                             
              end loop; 
                                                                     
          end; 
          

           

          Turns out, when passing NULL to the parameters, it is skips the parameter.

           

          Hope this helps someone.

           

          Thank you!