5 Replies Latest reply: Apr 9, 2013 12:02 AM by 942793 RSS

    Date Validation

    942793
      Hi,

      I have a date field in tabular form. I wants to do date validation on that field like approve_date should not be less than sysdate. On submit of apply button I wants to throw error message if wrong date is enter.
      How to achieve this validation and where is the appropriate place to write validation.

      Thanks & Regards,
      Sagarika
        • 1. Re: Date Validation
          Mindmap
          Hello,
          All what you have to do is:
          Edit your page. Under Page Processing
          Right click on Validating and choose create new validation.


          Choose your Tabular Form, then choose approve_date .
          Validation Type: SQL expression.

          Validation Code:
          :APPROVE_DATE > sysdate


          You can throw your message in the box of:
          Error Message

          ....
          Regards,
          Fateh
          -----------
          If you believe that my answer was correct or helpful, then please mark the answer as helpful or correct ....
          • 2. Re: Date Validation
            scott.wesley
            Although best to add explicit conversion, using the application date format.
            TO_DATE(:APPROVE_DATE) > sysdate
            • 3. Re: Date Validation
              942793
              Thanks Fateh.
              Its working.

              Regards,
              Sagarika
              • 4. Re: Date Validation
                942793
                Hi,

                I wants to do multiple validations on date fields on click of submit button.

                I have three date fields: applied_date, approved_date, reject_date. Validation details are given below,

                Pseudo code:

                IF approved_date IS NOT NULL and reject_date IS NOT NULL THEN
                Error message 'Either approved_date or reject_date should enter';
                ELSIF approved_date IS NOT NULL and reject_date IS THEN
                IF approved_date<applied_date THEN
                Error message 'aprroved_date should not be less than applied date';
                END IF;
                ELSIF approved_date IS NULL and reject_date IS NOT THEN
                IF reject_date<applied_date THEN
                Error message 'reject_date should not be less than applied date';
                END IF;
                ELSE null;
                END IF;

                I tried with creating validation in page processing but the above validation is not working.

                Please suggest me how to achieve this.


                Thanks & Regards,
                Sagarika
                • 5. Re: Date Validation
                  942793
                  Can anyone please help me out in this.

                  Thanks & Regards,
                  Sagarika