Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Validation Process: Function Returning Error Text

735312May 13 2011 — edited May 16 2011
Hello all. Can someone please HELP...

Simply trying to validate that a date isn't prior to the current date.

I have a form with "Next Review Date" displayed as Date Picker (MM/DD/YYYY), which populates a page item: P230_NEXT_REVIEW_DATE

I have a hidden field P230_SYSDATE (populates as DD-MON-YY) that holds the current date and I populate it's default value type: PL/SQL Function body

BEGIN
RETURN CURRENT_DATE;
END;


Using javascript, I verified that the values within the bind variables are populated, but I can't get the form to submit. Regardless of the date selected for NEXT_REVIEW_DATE, I get the error message from the validation process. Note: The validation process is set to When Button Pressed: SAVE(Apply Changes).

Here's my validation function:


DECLARE
v_error VARCHAR2 (4000);
BEGIN
if :P230_NEXT_REVIEW_DATE < :P230_SYSDATE THEN
v_error :=
v_error || 'Next Review Date is prior to current date. Please enter a valid date.' || '</br>';
END IF;

RETURN (v_error);
END;

I was thinking that dates need to be in the same format for the date arithmetic, but I've verified that Oracle can handle that issue.

Any advice would be great.

Thanks in advance.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 10 2011
Added on May 13 2011
2 comments
1,645 views