Search for:
HDL – Mass DELETE Document Record Attachments

Post refresh, the attachments from source environment gets copied to target environment. For data security, it is highly recommended to purge the attachments in lower environments. Oracle’s standard data masking feature doesn’t remove any attachments from the UCM.

In order to overcome this problem, I have created a BIP report which will pull details of all document records for all worker types having an attachment. The BIP generates data in HDL format, which can be saved as DocumentsOfRecord.dat.

Sample BIP data model query: (Below query can be filter based on document type or person number):

SELECT a.DATAROW
FROM
(
SELECT 'METADATA|DocumentAttachment|PersonNumber|DocumentTypeId|DocumentType|DocumentCode|DataTypeCode|Title|FileName' "DATAROW"
       ,1 row_num
  FROM DUAL
UNION 
SELECT 'DELETE|DocumentAttachment'||'|'||
       papf.person_number||'|'||
       hdor.document_type_id||'|'||
       hdtt.document_type||'|'||
       hdor.document_code||'|'||
       fd.datatype_code||'|'||
       fdt.title||'|'||
       fdt.file_name "DATAROW"
       ,2 row_num	   
  FROM per_all_people_f papf,
       hr_documents_of_record hdor,
	   hr_document_types_tl hdtt,
       fnd_attached_documents fad,
       fnd_documents_tl fdt,
       fnd_documents fd
 WHERE 1=1
   AND hdor.person_id = papf.person_id
   AND hdor.documents_of_record_id = fad.pk1_value
   AND fad.document_id = fdt.document_id
   AND fd.document_id = fdt.document_id
   AND fdt.language = 'US'
   AND fad.entity_name = 'HR_DOCUMENTS_OF_RECORD'
   AND hdor.document_type_id = hdtt.document_type_id
   AND hdtt.language = 'US'
   --AND papf.person_number = '269628'
   --AND hdtt.document_type = 'Passport Info'
   AND trunc(sysdate) between papf.effective_start_date and papf.effective_end_date
 ORDER BY row_num
)  a

Sample HDL File:

METADATA|DocumentAttachment|PersonNumber|DocumentTypeId|DocumentType|DocumentCode|DataTypeCode|Title|FileName
DELETE|DocumentAttachment|26628|300001270162314|Passport Info|Please Upload Passport Photo_2024-6-14-5-51-42|FILE|Passport Photo|10.Photo.jpeg
HDL – HDL to Load US EEO Information against location

There are many legislative required attributes defined against location object in HCM. These attributes are setup as EFF in Oracle fusion. These EFF attributes are protected against any updates.

One of the requirements is to bulk upload data against these EFF attributes and HDL can be used for this.

Below is a sample HDL to load “HR Reporting Location” attribute under “United States EEO and Veteran Reporting Information”:

METADATA|LocationLegislative|FLEX:PER_LOCATION_LEG_EFF|EFF_CATEGORY_CODE|_HR_REPORTING_LOCATION(PER_LOCATION_LEG_EFF=HRX_US_LOC_EEO_VETS_INF)|EffectiveStartDate|EffectiveEndDate|SourceSystemOwner|SourceSystemId|SetCode|LocationCode|LleInformationCategory|SequenceNumber|LegislationCode
MERGE|LocationLegislative|HRX_US_LOC_EEO_VETS_INF|HCM_LOC_LEG|Y|1951/01/01|4712/12/31|HRC_SQLLOADER|LOC_1001|COMMON|TEST_LOC_1|HRX_US_LOC_EEO_VETS_INF|1|US

Some of the important fields in above HDL are:

FLEX:PER_LOCATION_LEG_EFF – EFF Context – HRX_US_LOC_EEO_VETS_INF

EFF_CATEGORY_CODE – Should be HCM_LOC_LEG

LleInformationCategory – Should be same as EFF Context – HRX_US_LOC_EEO_VETS_INF

In case any of these attributes are not passed correctly, you will get an error:

An error occurred. To review details of the error run the HCM Data Loader Error Analysis Report diagnostic test.
Message details: JBO-26037: Cannot find matching EO from discriminator columns for view object LocationLegislativeHRX_5FUS_5FLOC_5FEEO_5FVETS_5FINFprivateVOLogical, entity base LocationLegislativeHRX_5FUS_5FLOC_5FEEO_5FVETS_5FINFprivateEO, discr value Discr values: HCM_LOC_LEG..