4 Replies Latest reply: Jan 22, 2013 1:36 AM by 714270 RSS

    How to validate  2 dates in Tabular form

    Pravish-Oracle
      Hello

      I have a tabular form. I have 2 columns end_date and extension_date. I need to create a validation saying " extension_date has to be greater than end_date". I tried below but it didn't worked. Any tips would be helpful.Thanks in advance.

      Validation details

      Column validation,
      Type: Function returning Boolean

      if to_date(:P40_EXTEND_DATE, 'DD-MON-YYYY HH:MIPM') > to_date(:P1_END_DATE, 'DD-MON-YYYY HH:MIPM')
      then
      return true;
      else
      return false;
      end if;
        • 1. Re: How to validate  2 dates in Tabular form
          714270
          pravish wrote:
          Hello

          I have a tabular form. I have 2 columns end_date and extension_date. I need to create a validation saying " extension_date has to be greater than end_date". I tried below but it didn't worked. Any tips would be helpful.Thanks in advance.

          Validation details

          Column validation,
          Type: Function returning Boolean

          if to_date(:P40_EXTEND_DATE, 'DD-MON-YYYY HH:MIPM') > to_date(:P1_END_DATE, 'DD-MON-YYYY HH:MIPM')
          then
          return true;
          else
          return false;
          end if;
          You can use the apex_application.g_fxx arrays instead of using bind variables in the validation code. To identify which apex_application.g_fxx arrays map to your date columns, you need to look at the generated HTML source of the page or refer to this link for details:
          http://www.inside-oracle-apex.com/which-tabular-form-column-is-mapped-to-which-apex_applicationg_fxx-array/

          Once you have identified the array elements, you can use them in your validation. One of the examples is explained here:
          http://apex.oracle.com/pls/otn/f?p=31517:41


          Thanks,
          Rohit
          • 2. Re: How to validate  2 dates in Tabular form
            Pravish-Oracle
            Hi Rohit, thanks for the tip.But i hit another issue. I have multiple rows in the form and the validation code is working for only first row.From the second row onwards the validation doesn't work. Any idea/tips?
            • 3. Re: How to validate  2 dates in Tabular form
              Pravish-Oracle
              Hi Rohit, I figured out the answer.

              THX A LOT

              Pravish
              • 4. Re: How to validate  2 dates in Tabular form
                714270
                I am glad that you figured it out.