Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
257 views

How To Create Custom Employee Number Generation Via Fast Formula

1. This document provides steps to create a custom employee number generation process using sequences and functions. 2. It involves creating a sequence, function to generate the desired sequence number, attaching a responsibility to manage business groups, and creating a formula function to generate and return the auto-number. 3. The formula function calls the custom number generation function, passing the person type and party ID to return the auto-generated number.

Uploaded by

Saquib.Mahmood
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
257 views

How To Create Custom Employee Number Generation Via Fast Formula

1. This document provides steps to create a custom employee number generation process using sequences and functions. 2. It involves creating a sequence, function to generate the desired sequence number, attaching a responsibility to manage business groups, and creating a formula function to generate and return the auto-number. 3. The formula function calls the custom number generation function, passing the person type and party ID to return the auto-generated number.

Uploaded by

Saquib.Mahmood
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

How to Create Custom Employee Number Generation via Fast Formula

1. Create Sequence
create sequence xyz_emp_number
start with 1
2. Create Function to Generate Desired Sequence Number
CREATE OR REPLACE FUNCTION XYZ_GENERATE_EMP_NUMBER
(
p_business_group_id IN NUMBER,
p_person_type
IN VARCHAR2,
p_party_id
IN NUMBER
) RETURN VARCHAR2 IS
l_emp_number
VARCHAR2(15) := NULL;
l_applicant_number VARCHAR2(15) := NULL;
l_npw_number
VARCHAR2(15) := NULL;
l_auto_number
VARCHAR2(15) := NULL;
BEGIN
BEGIN
SELECT employee_number,
applicant_number,
npw_number
INTO l_emp_number,
l_applicant_number,
l_npw_number
FROM per_all_people_f
WHERE party_id = p_party_id
AND TRUNC(SYSDATE) BETWEEN effective_start_date AND
effective_end_date;
EXCEPTION
WHEN OTHERS THEN
l_emp_number
:= NULL;
l_applicant_number := NULL;
l_npw_number
:= NULL;
END;
IF l_emp_number IS NULL AND l_applicant_number IS NULL AND
l_applicant_number IS NULL THEN
IF p_person_type = 'EMP' THEN
l_auto_number := 'XYZ-' || xyz_emp_number.NEXTVAL;
ELSIF p_person_type = 'APL' THEN
l_auto_number := 'APL-' || xyz_emp_number.NEXTVAL;
ELSIF p_person_type = 'CWK' THEN
l_auto_number := 'CONT-' || xyz_emp_number.NEXTVAL;
END IF;
END IF;
RETURN l_auto_number;
EXCEPTION
WHEN OTHERS THEN
NULL;

END;
/
3. Attach Setup Business Group to Global Super HRMS Manager
Navigation: System Administrator -> Profile -> System
Responsibility Name: Global Super HRMS Manager
Profile Option Name: HR: Security Profile
Set Profile as Setup Business Group at Responsibility Level

Note:
The Above Step is Mandatory as one cannot generate Auto Employee Numbering on
any custom Business Group. This could be possible on "Setup Business Group"

4. Create Formula Function:


I. Navigation: Go to Global Super HRMS Manager -> Other Definitions -> Formula
Functions
II. Function Name: XYZ_NUMBER_GENERATION
III. Parameters:
Data Type: Text
Class: External function
Definition: <Name of the Function> XYZ_GENERATE_EMP_NUMBER

Context Usages

Parameters

5. Create Fast Formula: EMP_NUMBER_GENERATION


Navigation: Global Super HRMS Manager -> Total Compensation -> Basic -> Write
Formulas
The Below Naming Convention should be used, so as to Generate Custom Auto
Numbering Sequence for Employee, Applicant or Contingent Worker
I. Employee EMP_NUMBER_GENERATION Person Number Generation
II. Applicant APL_NUMBER_GENERATION Person Number Generation
III. Employee CWK_NUMBER_GENERATION Person Number Generation

Type: Person Number Generation


Formula (For your Reference):
default for party_id is 0
inputs are
person_type (text),
party_id (number)
next_number = '0'
next_number = xyz_number_generation(person_type,party_id)

return next_number
Please note if one has different Numbering Sequence in-case of Multiple
business groups, it has to be handles via Fast Formula or PL/SQL Code

You might also like