Hi Friends,
Good Morning!
This is regarding Oracle APEX Interactive Grid fire error message when the user selects Past/Sysdate in the Date Picker column only for newly created rows NOT for old rows exists in the IG.
I have created the validation on END_DATE column to fire an error message when the user selects Past/Sysdate in the Date Picker column for new rows as shown below with Validation Type “**Function Body (returning Error Text)**”
PL/SQL Function Body Returning Error Text:
IF :APEX$ROW_STATUS = 'I' AND :END_DATE <= TRUNC(SYSDATE) THEN
RETURN 'End date must be in the future.';
END IF;
I have also tried to display only the Future dates in the End_Date column by creating a Hidden item (i.e., P0_FUTURE_DATE default value is ADD_MONTHS(SYSDATE, 10 * 12)) but when I use this option it throws the error message for existing rows when I add new rows in the IG.
Note:
I am storing the Interactive Grid using the manual SAVE button (i.e., instead of the default button of IG) and the SAVE button behavior is “Submit Page”.
The validation should not affect the existing dates on END_DATE column when the user clicks the manual SAVE button.
Question:
How to retain the old End Dates that have already been entered in END_DATE column and allow the users to only enter a future date and fire an error message (i.e., End date must be in the future) when the user selects Past/Sysdate date?
I appreciate if anyone give your suggestions or help in this regard.
Thank you so much in advance!
Iyappan
