Friday, December 13, 2024

OIC - How can we adjust a date to ensure it falls on a valid working day, excluding weekends and public holidays while comparing the feeded input day with the header record date in javascript?

Usecase:

If the input day of D1 record is greater than the day of the value date of RH record, the year and month should be set at 1 month before the value date of RH record.

(Note: Input day may be any day of the month i.e. 01 to 31,

but value date can only be a working day, i.e. Monday to Saturday except public holidays)

Example 1:

If input day = 25, value date of RH record = 20020926 (Thursday)

Then the input date is derived as 20020925 (Wednesday)

Example 2:

If input day = 31, value date of RH record = 20020902 (Monday)

Then the input date is derived as 20020831 (Saturday)

Example 3:

If input day = 31, value date of RH record = 20030102 (Thursday)

Then the input date is derived as 20021231 (Tuesday)

Example 4:

If input day = 31, value date of RH record = 20030204 (Tuesday)

Then the input date is derived as 20030131 (Friday)

Example 5:

If input day = 25, value date of RH record = 20250104

Then the input date is derived as 20241226


Javascript codes used:

function deriveInputDate1(inputDay, rhValueDate, publicHolidays) {

  // Convert rhValueDate to a Date object

  const rhDate = new Date(rhValueDate.slice(0, 4), rhValueDate.slice(4, 6) - 1, rhValueDate.slice(6));

  // If inputDay is greater than the day of rhDate, adjust the year and month

  if (inputDay > rhDate.getDate()) {

    rhDate.setMonth(rhDate.getMonth() - 1);

  }

  // Set the date to the inputDay

  rhDate.setDate(inputDay);

  // Ensure the date is a working day (Monday to Saturday, excluding public holidays)

  // Sunday is a non-working day

  while (rhDate.getDay() === 0 || isPublicHoliday(rhDate, publicHolidays)) {

    rhDate.setDate(rhDate.getDate() + 1);

  }

  // Format the derived date as YYYYMMDD

  const derivedDate = rhDate.getFullYear() +

    ('0' + (rhDate.getMonth() + 1)).slice(-2) +

    ('0' + rhDate.getDate()).slice(-2);

  return derivedDate;

}

// Helper function to check if a date is a public holiday

function isPublicHoliday(date, publicHolidays) {

  // Format the date as YYYY-MM-DD for comparison

  const formattedDate = date.getFullYear() +

    ('0' + (date.getMonth() + 1)).slice(-2) +

    ('0' + date.getDate()).slice(-2);

  return publicHolidays.includes(formattedDate);

}

Screenshot of the code:


OIC steps for integration creation:








Test result:






Note: Create a lookup and store the public holidays list which we will call from oic and assign to a variable and map to the derived function in mapper to exclude the public holidays.


Wednesday, December 11, 2024

OIC - Major steps to import HDL file To HCM | Upload to UCM and Run import and load data job

Usecase:

Here, we will demonstrate how we can import worker data as HDL filwle to HCM using following multple steps:

  1. Upload the hdl file(.zip file) to ucm
    1. Security group: FAFusionImportExport
    2. Doc account: hcm$/dataloader$/import$/
  2. Run importAndLoadData operation 
    1. Query, create update or delete information >> HCMDataloader service

Detailed screenshots:


















Tuesday, December 10, 2024

OIC - How to create Multiple type fixed length file native schema(NXSD)

Usecase:

Here, we will see how to create NXSD for a multiple type fixed length file in Jdeveloper.

Detailed screenshots:

New >> from Gallery 


Search nxsd >> next shchema


Next


Give file name


Select fixed length >> select the fixed length file


Select multiple records are of different types


Provide root name and target namespace


Provide end position. Here 2 to uniquely identify the records. >> Scan


Select each record type and provide the field positions. Like here file header has 3 fields each size 2, 8, 9 so that position will be 2,10(2+10),19(1+8+9)



Provide all the field names


Nxsd is ready and test and save.



Sunday, December 8, 2024

OIC Gen3 - SAAS to SAAS integration | Get Oracle Right Now Incidents for Oracle CRM (Oracle CX Sales application)

Usecase:

Here, we will do the following for SaaS to SaaS to integration.

  • Create two connections for oracle right now and oracle CRM(Oracle CX Sales)
  • Create integration and configure business object for Oracle CRM account as request and get response as Incident
  • Configure Oracle Right Now to get the incidents based on Org id using Right now object query language(ROQL).
  • Map the request to right noe and right now incidents back to the oracle CRM.

Detailed screenshots:























Featured Post

OIC - Padding leading zeros to a number field using xslt format-number()

In many payment-related integrations, credit card numbers often arrive as plain numeric strings. For security and compliance—and to meet tar...