Just starting out with oracle apex and looking for some advice.
I have a form where I need to enter header information. There is a date field called P100_ENTERED_DATE, and if the value entered in this field is less than the current date, I want to enable and make mandatory another field called P_100_REASON.
Would greatly appreciate any suggestions or tips on how to achieve this.
I attempted to use a JavaScript expression for a client-side condition as shown below, but it did not work:
WHEN: Event: Change Type: Item Item(s): :P100_ENTERED_DATE
Client-side Condition: Javascript Expression.
JS Expression:
var ld_cust_date = apex.item("P102_CUST_REQUEST_DATE").getValue();
var current_date = new Date();
if ((current_date - ld_cust_date) > 2){
return true
}
else {
return false
}
True Condition: Enable the field (I also want to make it mandatory, not sure how to do this) False Condition: Disable the field.