Wednesday 25 November 2015

How to register/delete procedure in User Hook

How to Register/Delete Procedure in User Hook





1)     Create API Hook Call (Register Procedure in User Hook)
·   Package Name: hr_api_hook_call_api.create_api_hook_call

declare
l_api_hook_call_id      number;
l_object_version_number number;
begin
hr_api_hook_call_api.create_api_hook_call
 (p_validate                                         => false,
  p_effective_date                             => to_date('01-JAN-1950,'DD-MON-YYYY'),
  p_api_hook_id                                   => 63,
  p_api_hook_call_type                    => 'PP',
  p_sequence                                       => 3000,
  p_enabled_flag                                => 'Y',
  p_call_package                                => 'SCOOP_NATIONALITY_CHECK',
  p_call_procedure                           => 'POLISH_NAME_CHECK',
  p_api_hook_call_id                         => l_api_hook_call_id,
  p_object_version_number         => l_object_version_number);
end;


         i.            The hook mechanism only supports calls to package procedures currently so api_hook_call_type must be PP.

       ii.            Sequence numbers > 2000 are recommended, as sequences < than 2000 are reserved for Oracle seeded logic which needs to be processed first. Please note that you can add any number of hooks to the same API, and order them using the sequence.

2)     Delete  API Hook Call (Delete Registered Procedure in User Hook)
·   Package Name: hr_api_hook_call_api.delete_api_hook_call

declare
l_api_hook_call_id      number := 2;
l_object_version_number number := 3;
begin
hr_api_hook_call_api.delete_api_hook_call
 (p_validate              => false,
  p_api_hook_call_id      => l_api_hook_call_id,
  p_object_version_number => l_object_version_number);
end;




Demo on how to register Procedure in User Hook:
 
--Step 1 
select * from hr_api_modules where module_name  ='CREATE_PERSON_ABSENCE'

-- Step 2
select ahk.api_hook_id,ahk.api_hook_type,
        ahk.hook_package,
        ahk.hook_procedure from hr_api_hooks ahk where
 api_module_id = 1739


-- Step 3 -- Get All registered Packages and Prcoedures
select * from hr_api_hook_calls  where api_hook_id = 3868 -- After Proccess


-- Step 3 – Complete Query
select ahk.api_hook_id,ahk.api_hook_type,
        ahk.hook_package,
        ahk.hook_procedure
   from hr_api_hooks ahk,
        hr_api_modules ahm
 where ahm.module_name='CREATE_PERSON_ABSENCE' 
  and ahk.api_module_id=ahm.api_module_id


-- How to Register Procedure to user Hook

declare
l_api_hook_call_id      number;
l_object_version_number number;
begin
hr_api_hook_call_api.create_api_hook_call
 (p_validate              => false,
  p_effective_date        => to_date('01-JAN-1950','DD-MON-YYYY'),
  p_api_hook_id           => 3868,-- API HOOK ID
  p_api_hook_call_type    => 'PP',
  p_sequence              => 3100,-- SEQ NO
  p_enabled_flag          => 'Y',
  p_call_package          => 'KFSH_WF_NOTIFY_PKG', -- Package Name
  p_call_procedure        => 'KFSH_NOTIFY_UNPAID_LEAVE_P', -- Procedure Name
  p_api_hook_call_id      => l_api_hook_call_id,
  p_object_version_number => l_object_version_number);
 
  dbms_output.put_line('Procedure Successfully Registered');
 
  exception
  when others then
    dbms_output.put_line(sqlerrm);
 
end;



-- Run the Pre Processor ----
DECLARE

BEGIN

    hr_api_user_hooks_utility.create_hooks_one_module(1739); -- Module ID
   
    dbms_output.put_line('Pre-Preocessor Run Successfully');
 
 
   exception
      when others then
        dbms_output.put_line(sqlerrm);

END;

Sunday 22 November 2015

API's For User Define Table

API's For User Define Table

Creating User Tables
----------------------------
pay_user_table_api.create_user_table()

Creating User Rows
---------------------------
pay_user_row_api.create_user_row()

Creating User Columns
-------------------------------
pay_user_column_api.create_user_column()


Crating user column instances or user table values
--------------------------------------------------------------------
pay_user_column_instance_api.create_user_column_instance()

Friday 6 November 2015

HRMS APIs

List of HRMS APIs  

1. Updating the Per_periods_of_service table using
hr_ex_employee_api.update_term_details_emp

2. Terminate employee
hr_ex_employee_api.actual_termination_emp
Applying the final process in the shared instance using hr_ex_employee_api.final_process_emp

3. Re – Hire Employee
hr_employee_api.re_hire_ex_employee

4. Update  Existing Person in system
hr_person_api.update_us_person

5. Hire New Emp
hr_employee_api.create_us_employee

6. Costing
pay_cost_allocation_api.create_cost_allocation

7. Load  Assignment
hr_assignment_api.update_us_emp_asg

8. Load Update Assign Criteria
hr_assignment_api.update_emp_asg_criteria
Note : Contact Person Id Is To Be Passed
hr_contact_rel_api.create_contact
Note : Contact Person Id is passed as Null(default of API)
hr_contact_rel_api.create_contact

9. Load Phones
hr_phone_api.create_phone
hr_person_address_api.update_person_address

10. Load Addresses
hr_person_address_api.update_person_address
hr_person_address_api.create_person_address

11. Load Payment Methods
hr_personal_pay_method_api.create_us_personal_pay_method

12. Element Loading
py_element_entry_api.create_element_entry
py_element_entry_api.update_element_entry

13. Load Salaries
hr_upload_proposal_api.upload_salary_proposal

14. Salary Proposal
hr_maintain_proposal_api.approve_salary_proposal

15. State tax rules
pay_state_tax_rule_api.create_state_tax_rule
pay_state_tax_rule_api.update_state_tax_rule

16.County Tax Rules
pay_county_tax_rule_api.create_county_tax_rule
pay_county_tax_rule_api.update_county_tax_rule

17. City Tax Rules
pay_city_tax_rule_api.create_city_tax_rule
pay_city_tax_rule_api.update_city_tax_rule

18. Schools and Colleges
per_esa_upd.upd
per_esa_ins.ins

19. Performance Reviews
hr_perf_review_api.create_perf_review
hr_perf_review_api.update_perf_review

20. State Information Taxes
hr_sit_api.update_sit
hr_sit_api.create_sit

21. Qualifications
per_qualifications_api.create_qualification
per_qualifications_api.update_qualification

22. Locations
hr_location_api.update_location
hr_location_api.create_location

23. Organization
hr_organization_api.update_organization
hr_organization_api.create_org_classification
If any Change in Organization information.
if information2 = ‘Y’ then
hr_organization_api.enable_org_classification
If any Change in Organization information.
if information2 = ‘N’ then
hr_organization_api.disable_org_classification
If Organization does not exist in instance
hr_organization_api.create_organization api

24. Jobs
hr_job_api.update_job
hr_job_api.create_job

25. Positions
hr_position_api.update_position

hr_position_api.create_position