HDL – Inactivating Worker Unions

HCM Data Loader can be used to bulk upload worker unions. In Cloud HCM, Worker Unions are just another type of Organization.

You can run below query to find different Organization Types and their codes:

https://fusionhcmconsulting.com/2021/01/reports-bip-organization-classifications-in-fusion/

Below is the sample file to inactivate a worker union:

METADATA|Organization|OrganizationId|EffectiveStartDate|EffectiveEndDate|Name|ClassificationCode|ClassificationName|InternalAddressLine|ActionReasonCode|LocationSetId|LocationCode|LocationSetCode|EstablishmentId|EstablishmentName|GUID|SourceSystemOwner|SourceSystemId
MERGE|Organization||1951/01/01|2021/05/12|Test WU2|ORA_PER_UNION||||||||||FUSION|300000217254520
MERGE|Organization||2021/05/13|4712/12/31|Test WU2|ORA_PER_UNION||||||||||FUSION|300000217254520

METADATA|OrgUnitClassification|OrgUnitClassificationId|EffectiveStartDate|EffectiveEndDate|OrganizationId(SourceSystemId)|OrganizationName|ClassificationCode|ClassificationName|CategoryCode|SetCode|Status|LegislationCode|GUID|SourceSystemOwner|SourceSystemId
MERGE|OrgUnitClassification||1951/01/01|2021/05/12|300000217254520|Test WU2|ORA_PER_UNION||||A|IN||FUSION|300000217254521
MERGE|OrgUnitClassification||2021/05/13|4712/12/31|300000217254520|Test WU2|ORA_PER_UNION||||I|IN||FUSION|300000217254521

The file makes use of Source keys. You can as well use the surrogate keys.

Below sample user surrogate keys:

METADATA|Organization|OrganizationId|EffectiveStartDate|EffectiveEndDate
MERGE|Organization|300000217254520|1951/01/01|2021/05/12
MERGE|Organization|300000217254520|2021/05/13|4712/12/31

METADATA|OrgUnitClassification|OrgUnitClassificationId|EffectiveStartDate|EffectiveEndDate|OrganizationId|Status
MERGE|OrgUnitClassification|300000217254521|1951/01/01|2021/05/12|300000217254520|A
MERGE|OrgUnitClassification|300000217254521|2021/05/13|4712/12/31|300000217254520|I

Sample Query to extract the data for Organization METADATA in HDL format:

SELECT 'METADATA|Organization|OrganizationId|EffectiveStartDate|EffectiveEndDate|OrganizationName' DATAROW, 1 sequence
FROM DUAL
UNION ALL
SELECT 'MERGE'
       ||CHR (124)
	   ||'Organization'
	   ||CHR (124)
	   ||haou.organization_id
	   ||CHR (124)
	   ||to_char(haou.effective_start_date,'RRRR/MM/DD')
	   ||CHR (124)
	   ||to_char(haou.effective_end_date,'RRRR/MM/DD')
	   ||CHR (124)
	   ||haout.name DATAROW, 2 sequence
FROM hr_all_organization_units haou,hr_all_organization_units_tl haout
where haou.organization_id = haout.organization_id
and haout.language ='US'
--AND haou.organization_id = 300000047274447
UNION ALL
SELECT 'METADATA|OrgUnitClassification|OrgUnitClassificationId|EffectiveStartDate|EffectiveEndDate|OrganizationId|Status' DATAROW, 3 sequence
FROM DUAL
UNION ALL
SELECT 'MERGE'
       ||CHR (124)
	   ||'OrgUnitClassification'
	   ||CHR (124)
	   ||houcf.org_unit_classification_id
	   ||CHR (124)
	   ||to_char(houcf.effective_start_date,'RRRR/MM/DD')
	   ||CHR (124)
	   ||to_char(houcf.effective_end_date,'RRRR/MM/DD')
	   ||CHR (124)
	   ||haou.organization_id
	   ||CHR (124)
	   ||houcf.status DATAROW, 4 sequence
FROM hr_all_organization_units haou,hr_org_unit_classifications_f houcf
where haou.organization_id = houcf.organization_id
--AND haou.organization_id = 300000047274447