Oracle OBR — Posttranformation to handle CurrentDate

Manikkavel N
2 min readJun 7, 2021

Let’s say, we have a requirement in Order Management — Sales Orders during Order entry to set Schedule Ship Date = Requested Ship Date, if Requested Date > Current Date and Schedule Ship Date = Current Date if Requested Date is in the past.

The article here explains how Schedule Ship Date is set using Post Tranformation Rules: FA: SCM: OM: How To Default Schedule Ship Date from Requested Ship Date Using PostTransformation Defaulting Rules (Doc ID 2190769.1)

We will be basically use the above article and build on the logic to handle Current Date. Below is the snippet of the rule without Current Date logic.

Now let’s add Current Date variable

In the “Then” portion of the rule we need to compare Current Date and Requested Ship Date, for this we need to compare Time units, since both the attributes are different data types. Hence convert them into a common datatype and use comparison operator.

Add below if (advanced) condition in then portion.

if (advanced) (Fline.RequestShipDate.time<CD.date.timeInMillis)

if (advanced) (Fline.RequestShipDate.time>=CD.date.timeInMillis)

Note I have also removed existing Assert New, since these statements should go inside the if blocks.

Add Assert New statements as follows under each if (advanced)

As you notice Current Date is not directly assigned to Schedule Ship Date attribute, it needs to be converted to timeInMillis and then assign.

Publish the rule.

--

--