0% found this document useful (0 votes)
663 views

Calling A Fast Formula From Another Formula and Dependent Query

This document contains two summaries: 1) The first section shows how to call a fast formula from another formula in Fusion HCM. It sets input values, calls the GET_HR_DATA formula, and returns an output value. 2) The second section is a script to get dependent data for an employee from various tables. It uses a cursor to loop through records and return the requested dependent's name, SSN, PCP, relationship type, or date based on an input field.

Uploaded by

hamdy20017121
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
663 views

Calling A Fast Formula From Another Formula and Dependent Query

This document contains two summaries: 1) The first section shows how to call a fast formula from another formula in Fusion HCM. It sets input values, calls the GET_HR_DATA formula, and returns an output value. 2) The second section is a script to get dependent data for an employee from various tables. It uses a cursor to loop through records and return the requested dependent's name, SSN, PCP, relationship type, or date based on an input field.

Uploaded by

hamdy20017121
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Fusion HCM - Calling a Fast Formula from another

Formula
Below is a Sample Formula showing How to Call a Fast Formula from another Formula :

DEFAULT FOR ASG_HR_ASG_ID    is 0


DEFAULT FOR PAY_EARN_PERIOD_END is '4712/12/31 00:00:00' (date)

SET_INPUT('HR_ASSIGNMENT_ID',ASG_HR_ASG_ID)
v_asg_id = ASG_HR_ASG_ID
l_date_earned = GET_CONTEXT(DATE_EARNED, PAY_EARN_PERIOD_END)

 CALL_FORMULA('GET_HR_DATA'
    ,ASG_HR_ASG_ID > 'HR_ID'
    ,l_date_earned > 'EFF_DATE'
    ,'PER_JOB_ATTRIBUTE1' > 'MODE'
    ,l_OUTPUT_TEXT < 'X_OUTPUT_TEXT' DEFAULT ' ')

v_job_att = l_OUTPUT_TEXT

RETURN v_job_att

Script to get dependents for Employee


CREATE OR REPLACE FUNCTION APPS.HR_GET_DEPENDENT(p_element_entry_id IN
NUMBER,
        p_contact_number IN NUMBER,
 p_data_field IN VARCHAR2)

RETURN VARCHAR2 IS
l_contact_name VARCHAR2(300);

CURSOR C1 IS
SELECT DEP.Full_Name Contact_Full_Name,
       DEP.National_Identifier,
       PCP.Name    PCP,
       LOOK.Meaning,
       DPNT.Cvg_Strt_Dt Effective_Start_Date,
       DPNT.Cvg_Thru_Dt Effective_End_Date
  FROM PER_PEOPLE_X              PER,
       PER_ASSIGNMENTS_X         ASG,
       PAY_ELEMENT_ENTRIES_X     ENTRY,
       BEN_PRTT_ENRT_RSLT_X      PEN,
       BEN_ELIG_CVRD_DPNT_X      DPNT,
       BEN_PRMRY_CARE_PRVDR_X    PCP,
       PER_PEOPLE_X              DEP,
       PER_CONTACT_RELATIONSHIPS REL,
       HR_LOOKUPS                LOOK
 WHERE ENTRY.Element_Entry_Id = P_Element_Entry_Id
   AND ENTRY.Assignment_Id = ASG.Assignment_Id
   AND ASG.Person_Id = PER.Person_Id
   AND PER.Person_Id = PEN.Person_Id
   AND PEN.Prtt_Enrt_Rslt_Id  = DPNT.Prtt_Enrt_Rslt_Id
   AND DPNT.Elig_Cvrd_Dpnt_Id = PCP.Elig_Cvrd_Dpnt_Id(+)
   AND DPNT.Dpnt_Person_Id = DEP.Person_Id
   AND REL.Person_Id = PER.Person_Id
   AND REL.Contact_Person_Id = DEP.Person_Id
   AND LOOK.Lookup_Type = 'CONTACT'
   AND REL.Contact_Type = LOOK.Lookup_Code;

x number := 0;

BEGIN

 FOR dep_rec IN C1 LOOP


   x := x + 1;

   IF x = p_contact_number THEN


  IF p_data_field = 'NAME' THEN
   l_contact_name := dep_rec.contact_full_name;
ELSIF p_data_field = 'SSN' THEN
   l_contact_name := dep_rec.national_identifier;
ELSIF p_data_field = 'PCP' THEN
   l_contact_name := dep_rec.pcp;
ELSIF p_data_field = 'TYPE' THEN --relationship_type
   l_contact_name := dep_rec.meaning;
ELSIF p_data_field = 'START' THEN -- start
   l_contact_name := dep_rec.effective_start_date;
ELSIF p_data_field = 'END' THEN -- end
   l_contact_name := dep_rec.effective_end_date;
END IF;

EXIT;

 END IF;

 END LOOP;

       RETURN l_contact_name;

EXCEPTION WHEN OTHERS THEN


     RETURN null;
END HR_GET_DEPENDENT;
/

You might also like