Monday, 28 February 2022

How to Change Non-Primary Work Relationship to Primary Using Worker.dat (Oracle Fusion HDL)

  


How to Change Non-Primary Work Relationship to Primary Using Worker.dat (Oracle Fusion HDL)

Introduction

In Oracle Fusion HCM, an employee can have only one Primary Work Relationship at any given time.

During data corrections or integrations, you may encounter a requirement to change an existing non-primary work relationship to primary.

Oracle Fusion allows this update using HCM Data Loader (HDL) by passing specific attributes in the Worker.dat file.

This blog explains:

  • When this scenario occurs

  • Required HDL attributes

  • Sample Worker.dat template

  • What happens after upload

📌 When Do You Need to Change Primary Work Relationship?

This scenario usually arises when:

  • Incorrect primary work relationship was loaded initially

  • Multiple work relationships exist (global transfer / rehiring)

  • Primary flag needs correction after data migration

  • Integration updates require switching the primary work relationship

✅ Important Rules to Remember

  • A person can have only ONE primary work relationship

  • When you mark a non-primary relationship as PrimaryFlag = Y, Oracle will:

    • Automatically change the existing primary work relationship to non-primary

  • The change must be effective-dated using DateForPrimaryFlagChange

🗂️ HDL File Used

👉 Worker.dat

This update is performed at the WorkRelationship business object level.


📄 Sample Worker.dat Template

Scenario

WorkRelationship Before Changes

Change an existing non-primary work relationship to primary.

METADATA|WorkRelationship|LegalEmployerName|DateStart|PersonNumber|ActualTerminationDate|NotifiedTerminationDate|LastWorkingDate|WorkerNumber|WorkerType|PrimaryFlag|DateForPrimaryFlagChange


MERGE|WorkRelationship|US Legal Entity|2015/10/26|XXTEST1|||||XXTEST1|E|Y|2015/10/26

📌 Key Points About the Sample

  • PrimaryFlag is set to Y

  • DateForPrimaryFlagChange must be:

    • On or after the work relationship start date

    • A valid effective date

  • The previously primary work relationship is automatically updated to non-primary

  • No manual update is required for the old primary record

🚀 After Upload – What Happens?

Once the Worker.dat file is:

  1. Zipped

  2. Loaded via My Client Groups → Data Exchange → Import and Load Data

  3. Successfully completed

Oracle Fusion will:

  • Update the selected work relationship as Primary

  • Demote the earlier primary work relationship to Non-Primary

  • Maintain data integrity without conflicts

After Changes 

⚠️ Common Errors & Tips

❌ Error: Person can have only one active Primary Work Relationship

✔ Ensure you are using:

  • PrimaryFlag = Y

  • DateForPrimaryFlagChange

❌ Error: Effective date mismatch

✔ Make sure:

  • DateForPrimaryFlagChange is valid

  • No future-dated conflicts exist

✅ Best Practices

✔ Always validate existing work relationships before update
✔ Test in lower environments first
✔ Use effective dates carefully
✔ Avoid updating Worker METADATA unless required


📌 Conclusion

Changing a non-primary work relationship to primary in Oracle Fusion HCM is fully supported using HDL, provided you pass the correct attributes in the Worker.dat file.

By using PrimaryFlag along with DateForPrimaryFlagChange, Oracle automatically handles the transition and ensures only one primary work relationship exists.

🔗 Related Articles & Internal Links

2 comments:

HDL Template for Dependent Enrollment in Oracle Fusion HCM (DependentEnrollment.dat)

  HDL Template for Dependent Enrollment in Oracle Fusion HCM (DependentEnrollment.dat) (Using DependentEnrollment.dat) Introduction In O...